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

Unified Diff: tools/android/loading/sandwich_swr.py

Issue 2112013003: sandwich: Use cachetool's batch mode to speed-up cache processing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@af00
Patch Set: s/Online/Batch Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/android/loading/sandwich_prefetch.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/sandwich_swr.py
diff --git a/tools/android/loading/sandwich_swr.py b/tools/android/loading/sandwich_swr.py
index 46910c4078cd3f09bc8b361f35ad6a72ceaf87b7..96730ba5b46507e642f1ffb2c6f0b126f7bbab36 100644
--- a/tools/android/loading/sandwich_swr.py
+++ b/tools/android/loading/sandwich_swr.py
@@ -26,7 +26,8 @@ def _BuildPatchedCache(original_cache_run_path, original_cache_archive_path,
with common_util.TemporaryDirectory(prefix='sandwich_tmp') as tmp_path:
cache_path = os.path.join(tmp_path, 'cache')
chrome_cache.UnzipDirectoryContent(original_cache_archive_path, cache_path)
- cache_backend = chrome_cache.CacheBackend(cache_path, 'simple')
+ cache_backend = chrome_cache.BatchCacheBackend(
+ cache_path, chrome_cache.CacheBackendType.SIMPLE)
cache_keys = set(cache_backend.ListKeys())
for request in trace.request_track.GetEvents():
if request.url not in cache_keys:
@@ -40,6 +41,7 @@ def _BuildPatchedCache(original_cache_run_path, original_cache_archive_path,
raw_headers = request.GetRawResponseHeaders()
cache_backend.UpdateRawResponseHeaders(request.url, raw_headers)
patch_count += 1
+ cache_backend.ProcessBatch()
chrome_cache.ZipDirectoryContent(cache_path, cache_archive_dest_path)
logging.info('Patched %d cached resources out of %d' % (
patch_count, len(cache_keys)))
« no previous file with comments | « tools/android/loading/sandwich_prefetch.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698