diff options
author | dstockwell <dstockwell@chromium.org> | 2015-04-27 22:37:35 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-28 05:37:33 +0000 |
commit | 13e95bde55343d1351b4879be84e13f9ac01bec2 (patch) | |
tree | 0bad7f5b4c5cd8e5b36cb293ecef428be6860418 | |
parent | 1ad9bfe4e302fd57bbffd45ec9ad248893a7b2ba (diff) | |
download | chromium_src-13e95bde55343d1351b4879be84e13f9ac01bec2.zip chromium_src-13e95bde55343d1351b4879be84e13f9ac01bec2.tar.gz chromium_src-13e95bde55343d1351b4879be84e13f9ac01bec2.tar.bz2 |
Make quiesence test best-effort in the blink_style benchmark
Some sites, notably techcrunch, in top25 were failing to reach readyState
complete or quiesence due to continual requests (possibly an artifact of
the wpr). As this benchmark normalizes/categories results, it shouldn't
be necessary to reach the same state on every run.
Also switches to a tighter tracing category which allows the reference build
to be re-enabled, since the metrics will not appear there until they are
valid to be consumed by the blink_style measurement.
BUG=479048
Review URL: https://codereview.chromium.org/1100853003
Cr-Commit-Position: refs/heads/master@{#327235}
-rw-r--r-- | tools/perf/benchmarks/blink_style.py | 3 | ||||
-rw-r--r-- | tools/perf/measurements/blink_style.py | 21 | ||||
-rw-r--r-- | tools/perf/measurements/blink_style_unittest.py | 2 |
3 files changed, 16 insertions, 10 deletions
diff --git a/tools/perf/benchmarks/blink_style.py b/tools/perf/benchmarks/blink_style.py index 4682b4f..827e81a0 100644 --- a/tools/perf/benchmarks/blink_style.py +++ b/tools/perf/benchmarks/blink_style.py @@ -7,7 +7,6 @@ from telemetry import benchmark from measurements import blink_style import page_sets -@benchmark.Disabled # http://crbug.com/479048 class BlinkStyleTop25(benchmark.Benchmark): """Measures performance of Blink's style engine (CSS Parsing, Style Recalc, etc.) on the top 25 pages. @@ -33,7 +32,7 @@ class BlinkStyleKeyMobileSites(benchmark.Benchmark): return 'blink_style.key_mobile_sites' -@benchmark.Disabled('mac', 'reference') # http://crbug.com/479048 +@benchmark.Enabled('android') class BlinkStylePolymer(benchmark.Benchmark): """Measures performance of Blink's style engine (CSS Parsing, Style Recalc, etc.) for Polymer cases. diff --git a/tools/perf/measurements/blink_style.py b/tools/perf/measurements/blink_style.py index f89ab98..f9ef875 100644 --- a/tools/perf/measurements/blink_style.py +++ b/tools/perf/measurements/blink_style.py @@ -4,8 +4,8 @@ from itertools import starmap from collections import defaultdict - from telemetry.core import util +from telemetry.core import exceptions from telemetry.page import page_test from telemetry.value import scalar @@ -19,7 +19,7 @@ class BlinkStyle(page_test.PageTest): def WillNavigateToPage(self, page, tab): self._controller = timeline_controller.TimelineController() - self._controller.trace_categories = 'blink,benchmark,blink.console' + self._controller.trace_categories = 'blink_style,blink.console' self._controller.SetUp(page, tab) self._controller.Start(tab) @@ -28,9 +28,15 @@ class BlinkStyle(page_test.PageTest): self._controller.CleanUp(tab) def ValidateAndMeasurePage(self, page, tab, results): - tab.WaitForDocumentReadyStateToBeComplete() - if not util.WaitFor(tab.HasReachedQuiescence, 30): - raise page_test.MeasurementFailure('Failed to reach quiesence.') + tab.ExecuteJavaScript('console.time("wait-for-quiescence");') + try: + util.WaitFor(tab.HasReachedQuiescence, 15) + except exceptions.TimeoutException: + # Some sites never reach quiesence. As this benchmark normalizes/ + # categories results, it shouldn't be necessary to reach the same + # state on every run. + pass + tab.ExecuteJavaScript('console.timeEnd("wait-for-quiescence");') tab.ExecuteJavaScript( 'console.time("style-update");' @@ -62,7 +68,10 @@ class BlinkStyle(page_test.PageTest): if (event.name == 'Document::updateStyle' and event.start >= marker.start and event.end <= marker.end): - access_count = event.args['resolverAccessCount'] + access_count = event.args.get('resolverAccessCount') + if access_count is None: + # absent in earlier versions + continue min_access_count = 50 if access_count >= min_access_count: diff --git a/tools/perf/measurements/blink_style_unittest.py b/tools/perf/measurements/blink_style_unittest.py index 7ba416c..6b711f9 100644 --- a/tools/perf/measurements/blink_style_unittest.py +++ b/tools/perf/measurements/blink_style_unittest.py @@ -4,7 +4,6 @@ from measurements import blink_style -from telemetry import decorators from telemetry.unittest_util import options_for_unittests from telemetry.unittest_util import page_test_test_case @@ -20,7 +19,6 @@ class BlinkStyleTest(page_test_test_case.PageTestTestCase): def setUp(self): self._options = options_for_unittests.GetCopy() - @decorators.Disabled # http://crbug.com/479048 def testForParsing(self): ps = self.CreatePageSetFromFileInUnittestDataDir('blink_style.html') measurement = blink_style.BlinkStyle() |