Merge lp:~jameinel/bzr/2.0.6-peak-commit-mem into lp:bzr/2.0
Status: | Merged |
---|---|
Approved by: | bzr PQM |
Approved revision: | not available |
Merged at revision: | not available |
Proposed branch: | lp:~jameinel/bzr/2.0.6-peak-commit-mem |
Merge into: | lp:bzr/2.0 |
Diff against target: |
53 lines (+9/-5) 2 files modified
NEWS (+7/-3) bzrlib/groupcompress.py (+2/-2) |
To merge this branch: | bzr merge lp:~jameinel/bzr/2.0.6-peak-commit-mem |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Collins (community) | Approve | ||
Review via email: mp+23718@code.launchpad.net |
Commit message
Reduce peak memory usage by 1 compressed text copy when compressing in 2a foramts.
Description of the change
I'm proposing this for 2.0 (and thus by extension for 2.1 and trunk). I chose 2.0 because it really is a rather trivial change that has a nice positive impact on peak memory when working with large files.
It is related to bug #566940, but this is really only 1 step out of many.
To test this, I created an 80mb file filled with incompressible data, and did 'bzr commit'. I also expanded the data with 'hexlify', which makes it 160mb, but should compress 2:1.
With the 80mb dataset, peak memory went from:
349MB => 267MB (82MB, aka 1 copy)
With the 160mb dataset, the peak memory went from:
465MB => 371MB (94MB, ~1 compressed size)
As near as I can tell, it is the removal of self._z_content which is saved. We still hold the fulltext in memory, because FulltextContent
Still, saving 1 copy of compressed content for a 1 line change is worthwhile.
Looks great to me.