diff options
author | simonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-13 00:06:09 +0000 |
---|---|---|
committer | simonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-13 00:06:09 +0000 |
commit | 3570ac4e041b3d2f7c314aa1094955d8c982fc13 (patch) | |
tree | ef7e5c3059222100807eb3ff2bc413fe0487aa91 /tools/perf | |
parent | 7832f39cbf4e06cefcd528219c418a00e443b0e0 (diff) | |
download | chromium_src-3570ac4e041b3d2f7c314aa1094955d8c982fc13.zip chromium_src-3570ac4e041b3d2f7c314aa1094955d8c982fc13.tar.gz chromium_src-3570ac4e041b3d2f7c314aa1094955d8c982fc13.tar.bz2 |
Add a Telemetry based cold startup test.
This shares most of its code with the startup_warm measurement. You
must now specify either --warm or --cold to run the new startup
measurement.
Due to splitting up the original patch for this into many pieces, some
of the earlier changes didn't all work together. There are also a
couple of fixes for those in here.
BUG=None
Review URL: https://chromiumcodereview.appspot.com/22300013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217126 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/benchmarks/startup.py | 20 | ||||
-rw-r--r-- | tools/perf/benchmarks/startup_warm.py | 11 | ||||
-rw-r--r-- | tools/perf/measurements/startup.py (renamed from tools/perf/measurements/startup_warm.py) | 34 | ||||
-rwxr-xr-x | tools/perf/run_measurement | 4 |
4 files changed, 50 insertions, 19 deletions
diff --git a/tools/perf/benchmarks/startup.py b/tools/perf/benchmarks/startup.py new file mode 100644 index 0000000..df8d050 --- /dev/null +++ b/tools/perf/benchmarks/startup.py @@ -0,0 +1,20 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +from telemetry import test + +from measurements import startup + + +class StartupColdBlankPage(test.Test): + test = startup.Startup + page_set = 'page_sets/blank_page.json' + options = {'cold': True, + 'pageset_repeat_iters': 5} + + +class StartupWarmBlankPage(test.Test): + test = startup.Startup + page_set = 'page_sets/blank_page.json' + options = {'warm': True, + 'pageset_repeat_iters': 20} diff --git a/tools/perf/benchmarks/startup_warm.py b/tools/perf/benchmarks/startup_warm.py deleted file mode 100644 index b132052..0000000 --- a/tools/perf/benchmarks/startup_warm.py +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. -from telemetry import test - -from measurements import startup_warm - - -class StartupWarmBlankPage(test.Test): - test = startup_warm.StartupWarm - page_set = 'page_sets/blank_page.json' diff --git a/tools/perf/measurements/startup_warm.py b/tools/perf/measurements/startup.py index 7c346b5..5792fee 100644 --- a/tools/perf/measurements/startup_warm.py +++ b/tools/perf/measurements/startup.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -6,9 +6,15 @@ import json from telemetry.page import page_measurement +class Startup(page_measurement.PageMeasurement): + """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,27 @@ 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(Startup, self).__init__(needs_browser_restart_after_each_run=True) + self._cold = False + + 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): + # TODO: Once the bots start running benchmarks, enforce that either --warm + # or --cold is explicitly specified. + # assert options.warm != options.cold, \ + # "You must specify either --warm or --cold" + self._cold = options.cold + + if self._cold: + options.clear_sytem_cache_for_browser_and_profile_on_start = True + else: + self.discard_first_result = True + options.AppendExtraBrowserArg('--enable-stats-collection-bindings') # Old commandline flags used for reference builds. @@ -35,7 +58,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) diff --git a/tools/perf/run_measurement b/tools/perf/run_measurement index dd5ecc8..9c103ce 100755 --- a/tools/perf/run_measurement +++ b/tools/perf/run_measurement @@ -78,8 +78,8 @@ def main(): "scrolling_benchmark": "smoothness", "smoothness_benchmark": "smoothness", "smoothness_measurement": "smoothness", - "startup_benchmark": "startup_warm", - "startup_measurement": "startup_warm", + "startup_benchmark": "startup_warm_blank_page", + "startup_measurement": "startup", "tab_switching_measurement": "tab_switching", } |