Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(912)

Issue 6546008: Improved memory usage while applying patch.... (Closed)

Created:
9 years, 10 months ago by sra1
Modified:
9 years, 7 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Improved memory usage while applying patch. Reduced total size of allocations from 520MB to 318MB. The general technique is to allocate the correct size rather than grow into the correct size and overshoot. 1. Find file sizes and allocate buffers of that size for the input files. 2. Pre-allocate a buffer for the collected inputs for the final diff. 3. Calculate the size for (2) during compression and include it in the patch header. The courgette.exe command line tool now calls the same ApplyEnsemblePatch entry point that is called by the installer. This ensures measurements of courgette.exe are a better reflection of the installer. BUG=72459 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=75787

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -16 lines) Patch
M courgette/courgette_tool.cc View 2 chunks +33 lines, -10 lines 4 comments Download
M courgette/ensemble.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M courgette/ensemble_apply.cc View 7 chunks +18 lines, -1 line 0 comments Download
M courgette/ensemble_create.cc View 3 chunks +8 lines, -0 lines 0 comments Download
M courgette/streams.h View 3 chunks +10 lines, -2 lines 0 comments Download
M courgette/streams.cc View 2 chunks +14 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
tommi (sloooow) - chröme
couple of questions/requests http://codereview.chromium.org/6546008/diff/1008/courgette/courgette_tool.cc File courgette/courgette_tool.cc (right): http://codereview.chromium.org/6546008/diff/1008/courgette/courgette_tool.cc#newcode306 courgette/courgette_tool.cc:306: courgette::ApplyEnsemblePatch(old_path.value().c_str(), would it be simpler to ...
9 years, 10 months ago (2011-02-23 06:35:59 UTC) #1
sra1
On 2011/02/23 06:35:59, tommi wrote: > couple of questions/requests > > http://codereview.chromium.org/6546008/diff/1008/courgette/courgette_tool.cc > File courgette/courgette_tool.cc ...
9 years, 10 months ago (2011-02-23 06:47:23 UTC) #2
sra1
http://codereview.chromium.org/6546008/diff/1008/courgette/courgette_tool.cc File courgette/courgette_tool.cc (right): http://codereview.chromium.org/6546008/diff/1008/courgette/courgette_tool.cc#newcode306 courgette/courgette_tool.cc:306: courgette::ApplyEnsemblePatch(old_path.value().c_str(), On 2011/02/23 06:35:59, tommi wrote: > would it ...
9 years, 10 months ago (2011-02-23 06:51:59 UTC) #3
tommi (sloooow) - chröme
9 years, 10 months ago (2011-02-23 06:53:36 UTC) #4
Sounds good.  LGTM.

On 2011/02/23 06:51:59, sra1 wrote:
> http://codereview.chromium.org/6546008/diff/1008/courgette/courgette_tool.cc
> File courgette/courgette_tool.cc (right):
> 
>
http://codereview.chromium.org/6546008/diff/1008/courgette/courgette_tool.cc#...
> courgette/courgette_tool.cc:306:
> courgette::ApplyEnsemblePatch(old_path.value().c_str(),
> On 2011/02/23 06:35:59, tommi wrote:
> > would it be simpler to make all ApplyEnsemplePatch functions just use const
> > FilePath&? (including this one)
> 
> I would like to keep the entry point with as simple an interface as possible.
> 
>
http://codereview.chromium.org/6546008/diff/1008/courgette/courgette_tool.cc#...
> courgette/courgette_tool.cc:314: std::string old_buffer = ReadOrFail(old_file,
> "'old' input");
> On 2011/02/23 06:35:59, tommi wrote:
> > remove these calls?
> 
> If the file does not exist, this is what gives the command line tool error. 
> This is simpler than testing explicitly, and this command is only used for
> testing and development.

Powered by Google App Engine
This is Rietveld 408576698