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

Unified Diff: tools/perf/measurements/startup.py

Issue 22300013: Add a Telemetry based cold startup test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
Index: tools/perf/measurements/startup.py
diff --git a/tools/perf/measurements/startup_warm.py b/tools/perf/measurements/startup.py
similarity index 59%
rename from tools/perf/measurements/startup_warm.py
rename to tools/perf/measurements/startup.py
index 7c346b5c50e2d34323210a7dc3b14410f25b1fe0..a243ce0183bd83e7b189fcc32eb013a25efe7215 100644
--- a/tools/perf/measurements/startup_warm.py
+++ b/tools/perf/measurements/startup.py
@@ -6,9 +6,15 @@ import json
from telemetry.page import page_measurement
+class StartupTest(page_measurement.PageMeasurement):
tonyg 2013/08/08 01:16:35 I think the precedent is to just call this "Startu
James Simonsen 2013/08/08 02:06:07 Done.
+ """Performs a measurement of Chromium's startup performance.
+
+ This test must be invoked with either --warm or --cold on the command line. A
+ cold start means none of the Chromium files are in the disk cache. A warm
+ start assumes the OS has already cached much of Chromium's content. For warm
+ tests, you should repeat the page set to ensure it's cached.
+ """
-class StartupWarm(page_measurement.PageMeasurement):
- """Test how long Chrome takes to load when warm."""
HISTOGRAMS_TO_RECORD = {
'messageloop_start_time' :
'Startup.BrowserMessageLoopStartTimeFromMainEntry',
@@ -16,10 +22,28 @@ class StartupWarm(page_measurement.PageMeasurement):
'open_tabs_time' : 'Startup.BrowserOpenTabs'}
def __init__(self):
- super(StartupWarm, self).__init__(needs_browser_restart_after_each_run=True,
- discard_first_result=True)
+ super(StartupTest, self).__init__(needs_browser_restart_after_each_run=True)
+ self._cold = False
+ self._warm = False
tonyg 2013/08/08 01:16:35 Let's use one bool so these can't get set improper
James Simonsen 2013/08/08 02:06:07 Done.
+
+ def AddCommandLineOptions(self, parser):
+ parser.add_option('--cold', action='store_true',
+ help='Clear the OS disk cache before performing the test')
+ parser.add_option('--warm', action='store_true',
+ help='Start up with everything already cached')
def CustomizeBrowserOptions(self, options):
+ assert options.warm != options.cold, \
+ "You must specify either --warm or --cold"
+ self._cold = options.cold
+ self._warm = options.warm
+
+ if self._cold:
+ options.clear_sytem_cache_for_browser_and_profile_on_start = True
+
+ if self._warm:
+ self.discard_first_result = True
+
options.AppendExtraBrowserArg('--enable-stats-collection-bindings')
# Old commandline flags used for reference builds.
@@ -35,7 +59,6 @@ class StartupWarm(page_measurement.PageMeasurement):
'statsCollectionController :'
'domAutomationController).getBrowserHistogram("%s")')
-
for display_name, histogram_name in self.HISTOGRAMS_TO_RECORD.iteritems():
result = tab.EvaluateJavaScript(get_histogram_js % histogram_name)
result = json.loads(result)

Powered by Google App Engine
This is Rietveld 408576698