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

Unified Diff: tools/telemetry/telemetry/core/platform/android_platform_backend.py

Issue 281723008: [Telemetry] Speed up page cycler by another ~20%. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/android_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/android_platform_backend.py b/tools/telemetry/telemetry/core/platform/android_platform_backend.py
index e65865f55a8b8f7770ee4ae90b8b4d3cffa90731..a785ebb7ed730256750481e0885da82067533221 100644
--- a/tools/telemetry/telemetry/core/platform/android_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/android_platform_backend.py
@@ -157,12 +157,12 @@ class AndroidPlatformBackend(
break
return child_pids
+ @decorators.Cache
def GetCommandLine(self, pid):
- ps = self._GetPsOutput(['pid', 'name'])
- for curr_pid, curr_name in ps:
- if int(curr_pid) == pid:
- return curr_name
- raise exceptions.ProcessGoneException()
+ ps = self._GetPsOutput(['pid', 'name'], pid)
+ if not ps:
+ raise exceptions.ProcessGoneException()
+ return ps[0][1]
def GetOSName(self):
return 'android'
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698