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

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

Issue 11366197: Refactoring benchmarks for perf bot efficiency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: tools/perf/perf_tools/smoothness_benchmark.py
diff --git a/tools/perf/perf_tools/scrolling_benchmark.py b/tools/perf/perf_tools/smoothness_benchmark.py
similarity index 73%
copy from tools/perf/perf_tools/scrolling_benchmark.py
copy to tools/perf/perf_tools/smoothness_benchmark.py
index 736703320cb6299f27323435ef0f4c3923b6e85c..bca1ebb5a32ca733bdb0d820b007c32bab29e606 100644
--- a/tools/perf/perf_tools/scrolling_benchmark.py
+++ b/tools/perf/perf_tools/smoothness_benchmark.py
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import multi_page_benchmark
+from telemetry import util
class DidNotScrollException(multi_page_benchmark.MeasurementFailure):
def __init__(self):
@@ -18,6 +19,7 @@ def DivideIfPossibleOrZero(numerator, denominator):
return numerator / denominator
def CalcScrollResults(rendering_stats_deltas, results):
+ # Scrolling
num_frames_sent_to_screen = rendering_stats_deltas['numFramesSentToScreen']
mean_frame_time_seconds = (
@@ -28,7 +30,11 @@ def CalcScrollResults(rendering_stats_deltas, results):
rendering_stats_deltas['droppedFrameCount'] /
float(num_frames_sent_to_screen))
+ results.Add('mean_frame_time', 'ms', round(mean_frame_time_seconds * 1000, 3))
+ results.Add('dropped_percent', '%', round(dropped_percent * 100, 1))
+
+ # Painting
totalPaintTime = GetOrZero('totalPaintTimeInSeconds',
rendering_stats_deltas)
@@ -41,16 +47,12 @@ def CalcScrollResults(rendering_stats_deltas, results):
totalPixelsRasterized = GetOrZero('totalPixelsRasterized',
rendering_stats_deltas)
-
megapixelsPaintedPerSecond = DivideIfPossibleOrZero(
(totalPixelsPainted / 1000000.0), totalPaintTime)
megapixelsRasterizedPerSecond = DivideIfPossibleOrZero(
(totalPixelsRasterized / 1000000.0), totalRasterizeTime)
- results.Add('mean_frame_time', 'ms', round(mean_frame_time_seconds * 1000, 3))
- results.Add('dropped_percent', '%', round(dropped_percent * 100, 1))
-
results.Add('total_paint_time', 'seconds', totalPaintTime)
results.Add('total_rasterize_time', 'seconds', totalRasterizeTime)
results.Add('total_pixels_painted', '', totalPixelsPainted)
@@ -61,9 +63,22 @@ def CalcScrollResults(rendering_stats_deltas, results):
results.Add('total_paint_and_rasterize_time', 'seconds', totalPaintTime +
totalRasterizeTime)
-class ScrollingBenchmark(multi_page_benchmark.MultiPageBenchmark):
+ # Texture Upload
+ if (('totalCommitCount' not in rendering_stats_deltas)
+ or rendering_stats_deltas['totalCommitCount'] == 0) :
+ averageCommitTimeMs = 0
+ else :
+ averageCommitTimeMs = (
+ 1000 * rendering_stats_deltas['totalCommitTimeInSeconds'] /
+ rendering_stats_deltas['totalCommitCount'])
+
+ results.Add('texture_upload_count', 'count',
+ GetOrZero('textureUploadCount', rendering_stats_deltas))
+ results.Add('average_commit_time', 'ms', averageCommitTimeMs)
+
+class SmoothnessBenchmark(multi_page_benchmark.MultiPageBenchmark):
def __init__(self):
- super(ScrollingBenchmark, self).__init__('scrolling')
+ super(SmoothnessBenchmark, self).__init__('scrolling')
def AddCommandLineOptions(self, parser):
parser.add_option('--no-gpu-benchmarking-extension', action='store_true',
@@ -87,6 +102,25 @@ class ScrollingBenchmark(multi_page_benchmark.MultiPageBenchmark):
if not (rendering_stats_deltas['numFramesSentToScreen'] > 0):
raise DidNotScrollException()
+ # First Paint Time
+ if tab.browser.is_content_shell:
+ results.Add('first_paint', 'seconds', 'unsupported')
+ return
nduca 2012/11/20 23:32:39 erm, you're skipping all further stuff here
hartmanng 2012/11/20 23:36:24 uh... oops...
+
+ tab.runtime.Execute("""
+ window.__rafFired = false;
+ window.webkitRequestAnimationFrame(function() {
+ window.__rafFired = true;
+ });
+ """)
+ util.WaitFor(lambda: tab.runtime.Evaluate('window.__rafFired'), 60)
+
+ first_paint_secs = tab.runtime.Evaluate(
+ 'window.chrome.loadTimes().firstPaintTime - ' +
+ 'window.chrome.loadTimes().requestTime')
+
+ results.Add('first_paint', 'seconds', round(first_paint_secs, 1))
+
CalcScrollResults(rendering_stats_deltas, results)
if self.options.report_all_results:
for k, v in rendering_stats_deltas.iteritems():
« no previous file with comments | « tools/perf/perf_tools/scrolling_benchmark_unittest.py ('k') | tools/perf/perf_tools/smoothness_benchmark_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698