diff options
author | sra@chromium.org <sra@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-23 21:18:48 +0000 |
---|---|---|
committer | sra@chromium.org <sra@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-23 21:18:48 +0000 |
commit | 6db3cd4ebccf65c9bbe1bb6d6239ec103caaf518 (patch) | |
tree | c2ab9d415c80ae62ff06fdbb8be3472271daacb0 /courgette/ensemble.h | |
parent | ce910b9d066453ea491473c4ef9e73b163a58d6d (diff) | |
download | chromium_src-6db3cd4ebccf65c9bbe1bb6d6239ec103caaf518.zip chromium_src-6db3cd4ebccf65c9bbe1bb6d6239ec103caaf518.tar.gz chromium_src-6db3cd4ebccf65c9bbe1bb6d6239ec103caaf518.tar.bz2 |
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
Review URL: http://codereview.chromium.org/6546008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75787 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'courgette/ensemble.h')
-rw-r--r-- | courgette/ensemble.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/courgette/ensemble.h b/courgette/ensemble.h index 6a58cb0..f907f9d 100644 --- a/courgette/ensemble.h +++ b/courgette/ensemble.h @@ -108,6 +108,7 @@ struct CourgettePatchFile { // version // source-checksum // target-checksum + // final-patch-input-size (an allocation hint) // multiple-streams: // stream 0: // number-of-transformed-elements (N) - varint32 @@ -136,7 +137,7 @@ struct CourgettePatchFile { static const uint32 kMagic = 'C' | ('o' << 8) | ('u' << 16); - static const uint32 kVersion = 20090320; + static const uint32 kVersion = 20110216; // Transformation method IDs. enum TransformationMethodId { |