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

Issue 2112013003: sandwich: Use cachetool's batch mode to speed-up cache processing. (Closed)

Created:
4 years, 5 months ago by gabadie
Modified:
4 years, 2 months ago
Reviewers:
pasko, mattcary
CC:
chromium-reviews, mikecase+watch_chromium.org, gabadie+watch_chromium.org, jbudorick+watch_chromium.org, lizeb+watch-android-loading_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@af00
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

sandwich: Use cachetool's batch mode to speed-up cache processing. Before Sandwich was forking a cachetool process for all modification of the cache directory but was slow. This CL fixes issue by using cachetool brand new batch mode that process cnn.com's home page's cache archive under 3s versus 491s originally. BUG=582080

Patch Set 1 #

Total comments: 22

Patch Set 2 : Avoid dead lock #

Patch Set 3 : Fixes a bug in OnlineCacheBackend._PushEnqueuedInsts() #

Patch Set 4 : Makes os.{read,write} non blocking #

Total comments: 3

Patch Set 5 : Adds comment around EAGAIN #

Patch Set 6 : Use Popen.communicate() #

Patch Set 7 : s/Online/Batch #

Unified diffs Side-by-side diffs Delta from patch set Stats (+231 lines, -49 lines) Patch
M tools/android/loading/chrome_cache.py View 1 2 3 4 5 6 10 chunks +212 lines, -36 lines 0 comments Download
M tools/android/loading/request_track.py View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M tools/android/loading/sandwich_prefetch.py View 1 2 3 4 5 6 4 chunks +15 lines, -11 lines 0 comments Download
M tools/android/loading/sandwich_swr.py View 1 2 3 4 5 6 2 chunks +3 lines, -1 line 0 comments Download

Depends on Patchset:

Messages

Total messages: 21 (3 generated)
gabadie
Hey Matt, Prototype of the python side that use cachetool's online mode to speed up ...
4 years, 5 months ago (2016-07-01 11:32:59 UTC) #2
mattcary
https://codereview.chromium.org/2112013003/diff/1/tools/android/loading/chrome_cache.py File tools/android/loading/chrome_cache.py (right): https://codereview.chromium.org/2112013003/diff/1/tools/android/loading/chrome_cache.py#newcode33 tools/android/loading/chrome_cache.py:33: Simple = 'simple' Constants should be all caps: SIMPLE, ...
4 years, 5 months ago (2016-07-01 12:09:30 UTC) #3
gabadie
Thanks! Uploaded a new revision. PTAL. https://codereview.chromium.org/2112013003/diff/1/tools/android/loading/chrome_cache.py File tools/android/loading/chrome_cache.py (right): https://codereview.chromium.org/2112013003/diff/1/tools/android/loading/chrome_cache.py#newcode33 tools/android/loading/chrome_cache.py:33: Simple = 'simple' ...
4 years, 5 months ago (2016-07-01 14:10:26 UTC) #4
mattcary
https://codereview.chromium.org/2112013003/diff/1/tools/android/loading/chrome_cache.py File tools/android/loading/chrome_cache.py (right): https://codereview.chromium.org/2112013003/diff/1/tools/android/loading/chrome_cache.py#newcode414 tools/android/loading/chrome_cache.py:414: self.Stop(force_stop=exc_type == CacheBackendError) On 2016/07/01 14:10:25, gabadie wrote: > ...
4 years, 5 months ago (2016-07-01 14:30:21 UTC) #5
gabadie
https://codereview.chromium.org/2112013003/diff/1/tools/android/loading/chrome_cache.py File tools/android/loading/chrome_cache.py (right): https://codereview.chromium.org/2112013003/diff/1/tools/android/loading/chrome_cache.py#newcode414 tools/android/loading/chrome_cache.py:414: self.Stop(force_stop=exc_type == CacheBackendError) On 2016/07/01 14:30:21, mattcary wrote: > ...
4 years, 5 months ago (2016-07-01 14:35:39 UTC) #6
gabadie
On 2016/07/01 14:35:39, gabadie wrote: > https://codereview.chromium.org/2112013003/diff/1/tools/android/loading/chrome_cache.py > File tools/android/loading/chrome_cache.py (right): > > https://codereview.chromium.org/2112013003/diff/1/tools/android/loading/chrome_cache.py#newcode414 > ...
4 years, 5 months ago (2016-07-01 15:08:33 UTC) #7
mattcary
lgtm Thanks for bearing with the unix file minutia. https://codereview.chromium.org/2112013003/diff/1/tools/android/loading/chrome_cache.py File tools/android/loading/chrome_cache.py (right): https://codereview.chromium.org/2112013003/diff/1/tools/android/loading/chrome_cache.py#newcode414 tools/android/loading/chrome_cache.py:414: ...
4 years, 5 months ago (2016-07-01 20:24:24 UTC) #8
gabadie
Thanks Matt for the review! Adding Egor. https://codereview.chromium.org/2112013003/diff/60001/tools/android/loading/chrome_cache.py File tools/android/loading/chrome_cache.py (right): https://codereview.chromium.org/2112013003/diff/60001/tools/android/loading/chrome_cache.py#newcode603 tools/android/loading/chrome_cache.py:603: if error.errno ...
4 years, 5 months ago (2016-07-04 14:23:16 UTC) #10
pasko
without looking into overall patch, see below for proposal to avoid fcntl and os.{read,write}. if ...
4 years, 5 months ago (2016-07-04 16:48:23 UTC) #11
pasko
https://codereview.chromium.org/2112013003/diff/1/tools/android/loading/chrome_cache.py File tools/android/loading/chrome_cache.py (right): https://codereview.chromium.org/2112013003/diff/1/tools/android/loading/chrome_cache.py#newcode495 tools/android/loading/chrome_cache.py:495: self._cachetool_process.stdin.write(inst_code) On 2016/07/01 14:35:39, gabadie wrote: > Of course ...
4 years, 5 months ago (2016-07-04 16:53:52 UTC) #12
chromium-reviews
> > > will that launch cachetool too many times? > > Yes, that's exactly ...
4 years, 5 months ago (2016-07-05 07:43:41 UTC) #13
chromium-reviews
On Jul 5, 2016 09:43, "Matthew Cary" <mattcary@google.com> wrote: >> >> >> will that launch ...
4 years, 5 months ago (2016-07-05 08:27:39 UTC) #14
chromium-reviews
As it says in the CL description, 3 seconds vs 491 seconds. I think it's ...
4 years, 5 months ago (2016-07-05 08:30:30 UTC) #15
chromium-reviews
making it start twice is more maintainable On Jul 5, 2016 10:30, "Matthew Cary" <mattcary@google.com> ...
4 years, 5 months ago (2016-07-05 08:36:42 UTC) #16
chromium-reviews
OK. I'll defer to Guillaume on that. On Tue, Jul 5, 2016 at 10:36 AM, ...
4 years, 5 months ago (2016-07-05 08:43:07 UTC) #17
gabadie
On 2016/07/05 08:36:42, chromium-reviews wrote: > making it start twice is more maintainable > On ...
4 years, 5 months ago (2016-07-06 09:26:48 UTC) #18
pasko
On 2016/07/06 09:26:48, gabadie wrote: > I am confused, why twice? that was my wild ...
4 years, 5 months ago (2016-07-06 15:03:43 UTC) #19
gabadie
4 years, 5 months ago (2016-07-06 16:15:16 UTC) #20
On 2016/07/06 15:03:43, pasko wrote:
> On 2016/07/06 09:26:48, gabadie wrote:
> > I am confused, why twice?
> 
> that was my wild guess: once to read all headers, and second time to perform
all
> mutations on the cache.

Same speed using Popen.communicate(), with one cachetool launch. However
functions such as ListKeys() GetSize() launches a new cachetool which is worst
than before. PTAL.

Powered by Google App Engine
This is Rietveld 408576698