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

Unified Diff: tools/perf/perf_tools/image_decoding_benchmark.py

Issue 11753023: [telemetry] Clean up image decoding benchmark (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Two pagesets Created 7 years, 12 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 | « tools/perf/page_sets/tough_image_cases.json ('k') | tools/telemetry/telemetry/page.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/perf_tools/image_decoding_benchmark.py
diff --git a/tools/perf/perf_tools/image_decoding_benchmark.py b/tools/perf/perf_tools/image_decoding_benchmark.py
index e23113445debda915ede4c72323cb2e282c990ae..c0df84eeed4a93e0b4c01fadc0adb184e6b4010c 100644
--- a/tools/perf/perf_tools/image_decoding_benchmark.py
+++ b/tools/perf/perf_tools/image_decoding_benchmark.py
@@ -3,20 +3,30 @@
# found in the LICENSE file.
from telemetry import multi_page_benchmark
-from telemetry import util
class ImageDecoding(multi_page_benchmark.MultiPageBenchmark):
- def MeasurePage(self, _, tab, results):
+ def WillNavigateToPage(self, page, tab):
+ tab.timeline.Start()
+
+ def MeasurePage(self, page, tab, results):
+ tab.timeline.Stop()
def _IsDone():
return tab.runtime.Evaluate('isDone')
- with tab.timeline.Recorder(tab.timeline):
- tab.runtime.Execute('runBenchmark()')
- util.WaitFor(_IsDone, 60)
- iterations = tab.runtime.Evaluate('minIterations')
- decode_image = tab.timeline.timeline_events.GetAllOfType('DecodeImage')
- elapsed_times = [d.elapsed_time for d in decode_image[-iterations:]]
+ decode_image_events = \
+ tab.timeline.timeline_events.GetAllOfType('DecodeImage')
+
+ # If it is a real image benchmark, then store only the last-minIterations
+ # decode tasks.
+ if (hasattr(page,
+ 'image_decoding_benchmark_limit_results_to_min_iterations') and
+ page.image_decoding_benchmark_limit_results_to_min_iterations):
+ assert _IsDone()
+ min_iterations = tab.runtime.Evaluate('minIterations')
+ decode_image_events = decode_image_events[-min_iterations:]
+
+ elapsed_times = [d.elapsed_time for d in decode_image_events]
if not elapsed_times:
results.Add('ImageDecoding_avg', 'ms', 'unsupported')
return
« no previous file with comments | « tools/perf/page_sets/tough_image_cases.json ('k') | tools/telemetry/telemetry/page.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698