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

Side by Side Diff: tools/perf/measurements/page_cycler.py

Issue 23431036: Create and display "comparison statistics" to compare two statistics Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to r233008. Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/telemetry/support/html_output/results-template.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """The page cycler measurement. 5 """The page cycler measurement.
6 6
7 This measurement registers a window load handler in which is forces a layout and 7 This measurement registers a window load handler in which is forces a layout and
8 then records the value of performance.now(). This call to now() measures the 8 then records the value of performance.now(). This call to now() measures the
9 time from navigationStart (immediately after the previous page's beforeunload 9 time from navigationStart (immediately after the previous page's beforeunload
10 event) until after the layout in the page's load event. In addition, two garbage 10 event) until after the layout in the page's load event. In addition, two garbage
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 return self._speedindex_metric.IsFinished(tab) 172 return self._speedindex_metric.IsFinished(tab)
173 util.WaitFor(SpeedIndexIsFinished, 60) 173 util.WaitFor(SpeedIndexIsFinished, 60)
174 self._speedindex_metric.Stop(page, tab) 174 self._speedindex_metric.Stop(page, tab)
175 self._speedindex_metric.AddResults( 175 self._speedindex_metric.AddResults(
176 tab, results, chart_name=chart_name_prefix+'speed_index') 176 tab, results, chart_name=chart_name_prefix+'speed_index')
177 177
178 def DidRunTest(self, browser, results): 178 def DidRunTest(self, browser, results):
179 self._memory_metric.AddSummaryResults(results) 179 self._memory_metric.AddSummaryResults(results)
180 io.IOMetric().AddSummaryResults(browser, results) 180 io.IOMetric().AddSummaryResults(browser, results)
181 181
182 # Add in comparison stats for cold->warm load improvements
183 results.AddComparison('page_load_time', 'cold_times',
184 'page_load_time', 'warm_times',
185 'page_load_times', 'cache_improvements')
186
182 def IsRunCold(self, url): 187 def IsRunCold(self, url):
183 return (self.ShouldRunCold(url) or 188 return (self.ShouldRunCold(url) or
184 (self._cold_runs_requested and 189 (self._cold_runs_requested and
185 self._has_loaded_page[url] == 0)) 190 self._has_loaded_page[url] == 0))
186 191
187 def ShouldRunCold(self, url): 192 def ShouldRunCold(self, url):
188 # We do the warm runs first for two reasons. The first is so we can 193 # We do the warm runs first for two reasons. The first is so we can
189 # preserve any initial profile cache for as long as possible. 194 # preserve any initial profile cache for as long as possible.
190 # The second is that, if we did cold runs first, we'd have a transition 195 # The second is that, if we did cold runs first, we'd have a transition
191 # page set during which we wanted the run for each URL to both 196 # page set during which we wanted the run for each URL to both
192 # contribute to the cold data and warm the catch for the following 197 # contribute to the cold data and warm the catch for the following
193 # warm run, and clearing the cache before the load of the following 198 # warm run, and clearing the cache before the load of the following
194 # URL would eliminate the intended warmup for the previous URL. 199 # URL would eliminate the intended warmup for the previous URL.
195 return (self._cold_runs_requested and 200 return (self._cold_runs_requested and
196 self._has_loaded_page[url] >= self._cold_run_start_index) 201 self._has_loaded_page[url] >= self._cold_run_start_index)
197 202
198 def results_are_the_same_on_every_page(self): 203 def results_are_the_same_on_every_page(self):
199 return not self._cold_runs_requested 204 return not self._cold_runs_requested
OLDNEW
« no previous file with comments | « no previous file | tools/telemetry/support/html_output/results-template.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698