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

Issue 97133002: Add instance-level in-memory cache for PushIfNeeded(). (Closed)

Created:
7 years ago by Philippe
Modified:
7 years ago
Reviewers:
craigdh, bulach, tonyg, frankf
CC:
chromium-reviews, craigdh+watch_chromium.org, bulach+watch_chromium.org, yfriedman+watch_chromium.org, ilevy-cc_chromium.org, klundberg+watch_chromium.org, frankf+watch_chromium.org
Visibility:
Public.

Description

Add instance-level in-memory cache for PushIfNeeded(). This speeds up PushIfNeeded() execution times on a same instance of AndroidCommands for repetitive files. This can be achieved by mapping host file paths to their mtime at push time as tonyg@ pointed out although this assumes that the device doesn't modify the files. This is needed to make PurgeUnpinnedAshmem() reasonably fast to execute in Telemetry. This CL decreases by 40 secs the execution time of netsim.top_10 whem memory is measured for each page (and PurgeUnpinnedAshmem() is called before each measurement). BUG=323494, 326929 R=bulach@chromium.org, craigdh@chromium.org, tonyg@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=239757

Patch Set 1 #

Total comments: 4

Patch Set 2 : Don't cache mtime for directories #

Total comments: 1

Patch Set 3 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -0 lines) Patch
M build/android/pylib/android_commands.py View 1 2 3 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Philippe
7 years ago (2013-11-29 16:13:08 UTC) #1
bulach
lgtm once the bots (and frank/craig) are happy, thanks!! the long term fix is to ...
7 years ago (2013-11-29 16:28:41 UTC) #2
tonyg
lgtm
7 years ago (2013-11-29 16:54:26 UTC) #3
Philippe
On 2013/11/29 16:54:26, tonyg wrote: > lgtm Thanks guys! I'm now waiting for Frank/Craig.
7 years ago (2013-12-02 09:04:45 UTC) #4
craigdh
https://chromiumcodereview.appspot.com/97133002/diff/1/build/android/pylib/android_commands.py File build/android/pylib/android_commands.py (right): https://chromiumcodereview.appspot.com/97133002/diff/1/build/android/pylib/android_commands.py#newcode924 build/android/pylib/android_commands.py:924: if host_path in self._push_if_needed_cache: What about when |host_path| is ...
7 years ago (2013-12-02 17:09:35 UTC) #5
Philippe
https://chromiumcodereview.appspot.com/97133002/diff/1/build/android/pylib/android_commands.py File build/android/pylib/android_commands.py (right): https://chromiumcodereview.appspot.com/97133002/diff/1/build/android/pylib/android_commands.py#newcode924 build/android/pylib/android_commands.py:924: if host_path in self._push_if_needed_cache: On 2013/12/02 17:09:36, craigdh wrote: ...
7 years ago (2013-12-02 17:16:43 UTC) #6
craigdh
https://chromiumcodereview.appspot.com/97133002/diff/1/build/android/pylib/android_commands.py File build/android/pylib/android_commands.py (right): https://chromiumcodereview.appspot.com/97133002/diff/1/build/android/pylib/android_commands.py#newcode924 build/android/pylib/android_commands.py:924: if host_path in self._push_if_needed_cache: On 2013/12/02 17:16:43, Philippe wrote: ...
7 years ago (2013-12-02 18:20:19 UTC) #7
Philippe
Thanks Craig! Please see my comment below. https://chromiumcodereview.appspot.com/97133002/diff/1/build/android/pylib/android_commands.py File build/android/pylib/android_commands.py (right): https://chromiumcodereview.appspot.com/97133002/diff/1/build/android/pylib/android_commands.py#newcode924 build/android/pylib/android_commands.py:924: if host_path ...
7 years ago (2013-12-03 10:31:31 UTC) #8
Philippe
Ping? :) On Tue, Dec 3, 2013 at 11:31 AM, <pliard@chromium.org> wrote: > Thanks Craig! ...
7 years ago (2013-12-05 10:00:46 UTC) #9
craigdh
> > What do you think? I would be happy to file a bug tracking ...
7 years ago (2013-12-05 20:07:51 UTC) #10
Philippe
On 2013/12/05 20:07:51, craigdh wrote: > > > What do you think? I would be ...
7 years ago (2013-12-09 09:30:52 UTC) #11
Philippe
On 2013/12/09 09:30:52, Philippe wrote: > On 2013/12/05 20:07:51, craigdh wrote: > > > > ...
7 years ago (2013-12-10 10:31:01 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pliard@chromium.org/97133002/20001
7 years ago (2013-12-10 10:31:25 UTC) #13
commit-bot: I haz the power
Failed to apply patch for build/android/pylib/android_commands.py: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years ago (2013-12-10 10:31:31 UTC) #14
Philippe
Committed patchset #3 manually as r239757 (presubmit successful).
7 years ago (2013-12-10 11:27:54 UTC) #15
craigdh
7 years ago (2013-12-10 19:23:31 UTC) #16
Message was sent while issue was closed.
Whoops, forgot to publish my draft comments.

https://chromiumcodereview.appspot.com/97133002/diff/20001/build/android/pyli...
File build/android/pylib/android_commands.py (right):

https://chromiumcodereview.appspot.com/97133002/diff/20001/build/android/pyli...
build/android/pylib/android_commands.py:954: if not os.path.isdir(host_path):
If we're only doing this for single files, then instead of doing this in the
loop (calling os.path.isdir for every file when we're pushing large directories)
just stick it at the end of PushIfNeeded (line 980). An exception is raised if
the push fails so this will only be cached if the file is successfully pushed.

Powered by Google App Engine
This is Rietveld 408576698