diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-11-30 00:25:16 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-11-30 00:25:16 +0000 |
commit | c0f37c99955c0c85df10db9da8dc586fff8b7bcb (patch) | |
tree | f4eb1bd13e1d677d9f13b30215e3538064725419 | |
parent | b26085b20cc0c905f440a4111d4c78153bd9b4c0 (diff) | |
parent | 73e5ad7924a17f76b06d92c80a0d6b3b20f7dd2f (diff) | |
download | update_engine-c0f37c99955c0c85df10db9da8dc586fff8b7bcb.tar.gz |
Snap for 11157599 from 73e5ad7924a17f76b06d92c80a0d6b3b20f7dd2f to 24Q1-release
Change-Id: I8487c64719c24dfc14e0b0eebe92bc0374d49188
-rw-r--r-- | lz4diff/lz4patch.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lz4diff/lz4patch.cc b/lz4diff/lz4patch.cc index 9de6d580..17fd8a23 100644 --- a/lz4diff/lz4patch.cc +++ b/lz4diff/lz4patch.cc @@ -172,10 +172,14 @@ bool bspatch(std::string_view input_data, bool puffpatch(std::string_view input_data, std::string_view patch_data, Blob* output) { + // Cache size has a big impact on speed of puffpatch, use a default of 5MB to + // match update_engine behavior. + static constexpr size_t kPuffPatchCacheSize = 5 * 1024 * 1024; return puffin::PuffPatch(std::make_unique<StringViewStream>(input_data), puffin::MemoryStream::CreateForWrite(output), reinterpret_cast<const uint8_t*>(patch_data.data()), - patch_data.size()); + patch_data.size(), + kPuffPatchCacheSize); } std::vector<CompressedBlock> ToCompressedBlockVec( |