aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes2016-04-19 17:24:38 -0500
committerElliott Hughes2016-04-19 17:24:38 -0500
commitdd895d0adaa691a078f18a95a7f5ac0eaf776cae (patch)
treebb3c5e356f05da06dea3b3fb9430650e1b3d1945 /verifier.cpp
parente8d0ecccf7e54e73418cac94b0b136bfed94d51a (diff)
downloadplatform-bootable-recovery-dd895d0adaa691a078f18a95a7f5ac0eaf776cae.tar.gz
platform-bootable-recovery-dd895d0adaa691a078f18a95a7f5ac0eaf776cae.tar.xz
platform-bootable-recovery-dd895d0adaa691a078f18a95a7f5ac0eaf776cae.zip
Decrease OTA package verification times further.
Timing from Nexus 5X: 89 MiB OTA update package: 1.4 s -> 0.6 s (decreased by 57%) 1196 MiB OTA update package: 8.0 s -> 7.5 s (decreased by 6%) Bug: http://b/28135231 Change-Id: Id91f2ad15df2bffb9f8a4b4ec5a57657a02847ec
Diffstat (limited to 'verifier.cpp')
-rw-r--r--verifier.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/verifier.cpp b/verifier.cpp
index 4004b022..f5299b4a 100644
--- a/verifier.cpp
+++ b/verifier.cpp
@@ -206,10 +206,10 @@ int verify_file(unsigned char* addr, size_t length,
206 double frac = -1.0; 206 double frac = -1.0;
207 size_t so_far = 0; 207 size_t so_far = 0;
208 while (so_far < signed_len) { 208 while (so_far < signed_len) {
209 // On a Nexus 9, experiment didn't show any performance improvement with 209 // On a Nexus 5X, experiment showed 16MiB beat 1MiB by 6% faster for a
210 // larger sizes past 1MiB, and they reduce the granularity of the progress 210 // 1196MiB full OTA and 60% for an 89MiB incremental OTA.
211 // bar. http://b/28135231. 211 // http://b/28135231.
212 size_t size = std::min(signed_len - so_far, 1 * MiB); 212 size_t size = std::min(signed_len - so_far, 16 * MiB);
213 213
214 if (need_sha1) SHA1_Update(&sha1_ctx, addr + so_far, size); 214 if (need_sha1) SHA1_Update(&sha1_ctx, addr + so_far, size);
215 if (need_sha256) SHA256_Update(&sha256_ctx, addr + so_far, size); 215 if (need_sha256) SHA256_Update(&sha256_ctx, addr + so_far, size);