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

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

Issue 918633003: Add a telemetry measurement for property tree performance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 from telemetry.core.platform import tracing_category_filter
6 from telemetry.core.platform import tracing_options
7 from telemetry.page import page_test
8 from telemetry.timeline import model
9 from telemetry.value import scalar
10
11
12 class DrawProperties(page_test.PageTest):
13 def __init__(self):
14 super(DrawProperties, self).__init__(
15 action_name_to_run='RunPageInteractions')
16
17 def CustomizeBrowserOptions(self, options):
18 options.AppendExtraBrowserArgs([
19 '--enable-property-tree-verification',
20 '--enable-prefer-compositing-to-lcd-text',
21 ])
22
23 def WillNavigateToPage(self, page, tab):
24 options = tracing_options.TracingOptions()
25 options.enable_chrome_trace = True
26 category_filter = tracing_category_filter.TracingCategoryFilter(
27 'disabled-by-default-cc.debug.cdp-perf')
28 tab.browser.platform.tracing_controller.Start(options, category_filter)
29
30 def ValidateAndMeasurePage(self, page, tab, results):
31 timeline_data = tab.browser.platform.tracing_controller.Stop()
32 timeline_model = model.TimelineModel(timeline_data)
33
34 def _IsDone():
35 return tab.EvaluateJavaScript('isDone')
sullivan 2015/02/26 21:59:02 I think this function is unneeded? I don't see it
Ian Vollick 2015/02/26 22:59:39 Done.
36
37 cdp_events = timeline_model.GetAllEventsOfName(
38 "LayerTreeHostCommon::CalculateDrawProperties");
39
40 cdp_durations = [d.duration for d in cdp_events]
41 assert cdp_durations, 'Failed to find cdp durations'
42
43 cdp_sum = sum(cdp_durations)
44 cdp_count = len(cdp_durations)
45 cdp_avg = cdp_sum / cdp_count
46
47 pt_events = timeline_model.GetAllEventsOfName(
48 "LayerTreeHostCommon::ComputeVisibleRectsWithPropertyTrees");
49
50 pt_durations = [d.duration for d in pt_events]
51 assert pt_durations, 'Failed to find pt durations'
52
53 pt_sum = sum(pt_durations)
54 pt_count = len(pt_durations)
55 pt_avg = pt_sum / pt_count
sullivan 2015/02/26 21:59:02 Could put this duplicated code into a function.
Ian Vollick 2015/02/26 22:59:39 Done.
56
57 reduction = 100.0 * (1.0 - (pt_sum / cdp_sum))
58
59 results.AddValue(scalar.ScalarValue(
60 results.current_page, 'CDP_reduction', ' %', reduction,
61 description='Reduction in CDP cost with property trees'))
62
63 results.AddValue(scalar.ScalarValue(
64 results.current_page, 'CDP_avg_cost', 'ms', cdp_avg,
65 description='Average time spent in CDP'))
66
67 results.AddValue(scalar.ScalarValue(
68 results.current_page, 'PT_avg_cost', 'ms', pt_avg,
69 description='Average time spent processing property trees'))
70
71 def CleanUpAfterPage(self, page, tab):
72 tracing_controller = tab.browser.platform.tracing_controller
73 if tracing_controller.is_tracing_running:
74 tracing_controller.Stop()
OLDNEW
« tools/perf/benchmarks/draw_properties.py ('K') | « tools/perf/benchmarks/draw_properties.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698