OLD | NEW |
---|---|
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 import re | 5 import re |
6 | 6 |
7 from core import perf_benchmark | 7 from core import perf_benchmark |
8 | 8 |
9 from telemetry import benchmark | 9 from telemetry import benchmark |
10 from telemetry.timeline import tracing_category_filter | 10 from telemetry.timeline import tracing_category_filter |
11 from telemetry.web_perf import timeline_based_measurement | 11 from telemetry.web_perf import timeline_based_measurement |
12 from telemetry.web_perf.metrics import memory_timeline | 12 from telemetry.web_perf.metrics import memory_timeline |
13 from telemetry.web_perf.metrics import v8_gc_latency | |
14 | 13 |
15 import page_sets | 14 import page_sets |
16 | 15 |
17 | 16 |
18 class _MemoryInfra(perf_benchmark.PerfBenchmark): | 17 class _MemoryInfra(perf_benchmark.PerfBenchmark): |
19 """Base class for new-generation memory benchmarks based on memory-infra. | 18 """Base class for new-generation memory benchmarks based on memory-infra. |
20 | 19 |
21 This benchmark records data using memory-infra (https://goo.gl/8tGc6O), which | 20 This benchmark records data using memory-infra (https://goo.gl/8tGc6O), which |
22 is part of chrome tracing, and extracts it using timeline-based measurements. | 21 is part of chrome tracing, and extracts it using timeline-based measurements. |
23 """ | 22 """ |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 class MemoryBenchmarkTop10Mobile(_MemoryInfra): | 110 class MemoryBenchmarkTop10Mobile(_MemoryInfra): |
112 """Timeline based benchmark for measuring memory on top 10 mobile sites.""" | 111 """Timeline based benchmark for measuring memory on top 10 mobile sites.""" |
113 | 112 |
114 page_set = page_sets.MemoryInfraTop10MobilePageSet | 113 page_set = page_sets.MemoryInfraTop10MobilePageSet |
115 | 114 |
116 @classmethod | 115 @classmethod |
117 def Name(cls): | 116 def Name(cls): |
118 return 'memory.top_10_mobile' | 117 return 'memory.top_10_mobile' |
119 | 118 |
120 | 119 |
120 class _MemoryV8Benchmark(_MemoryInfra): | |
121 def CreateTimelineBasedMeasurementOptions(self): | |
122 v8_categories = [ | |
petrcermak
2016/04/27 16:22:17
v8_categories and memory_categories could be class
ulan
2016/04/28 14:34:35
Since they are not reused, I'd prefer to keep them
petrcermak
2016/04/28 14:38:45
if you prefix them with an underscore, they will t
| |
123 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console'] | |
124 memory_categories = ['blink.console', 'disabled-by-default-memory-infra'] | |
125 all_categories = v8_categories + memory_categories | |
petrcermak
2016/04/27 16:22:17
1) Note that this will contain 'blink.console' twi
ulan
2016/04/28 14:34:35
2, 3 - done. TracingCategoryFilter can handle dupl
| |
126 category_filter = tracing_category_filter.TracingCategoryFilter( | |
127 ','.join(all_categories)) | |
128 options = timeline_based_measurement.Options(category_filter) | |
129 return options | |
130 | |
131 def SetupBenchmarkDefaultTraceRerunOptions(self, tbm_options): | |
perezju
2016/04/27 16:29:42
we're getting rid of these TraceRerun* methods, ju
ulan
2016/04/28 14:34:35
I tried to that, but then _MemoryInfra.SetupBenchm
perezju
2016/04/28 14:45:09
This is no longer true after Petr's CL https://cod
| |
132 tbm_options.SetTimelineBasedMetric('v8AndMemoryMetrics') | |
133 | |
petrcermak
2016/04/27 16:22:17
nit: add one more blank line here (there should be
ulan
2016/04/28 14:34:35
Done.
| |
121 # Disabled on reference builds because they don't support the new | 134 # Disabled on reference builds because they don't support the new |
122 # Tracing.requestMemoryDump DevTools API. | 135 # Tracing.requestMemoryDump DevTools API. |
123 # For 'reference' see http://crbug.com/540022. | 136 # For 'reference' see http://crbug.com/540022. |
124 # For 'android' see http://crbug.com/579546. | 137 # For 'android' see http://crbug.com/579546. |
perezju
2016/04/27 16:29:43
That bug shows that the (non-tbm) benchmark was re
ulan
2016/04/28 14:34:35
Acknowledged. I will re-enable in a different CL.
| |
125 @benchmark.Disabled('reference', 'android') | 138 @benchmark.Disabled('reference', 'android') |
126 class MemoryLongRunningIdleGmailTBM(_MemoryInfra): | 139 class MemoryLongRunningIdleGmail(_MemoryV8Benchmark): |
127 """Use (recorded) real world web sites and measure memory consumption | 140 """Use (recorded) real world web sites and measure memory consumption |
128 of long running idle Gmail page """ | 141 of long running idle Gmail page """ |
129 page_set = page_sets.LongRunningIdleGmailPageSet | 142 page_set = page_sets.LongRunningIdleGmailPageSet |
130 | 143 |
131 def CreateTimelineBasedMeasurementOptions(self): | 144 @classmethod |
132 v8_categories = [ | 145 def Name(cls): |
133 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console'] | 146 return 'memory.long_running_idle_gmail_tbmv2' |
134 memory_categories = 'blink.console,disabled-by-default-memory-infra' | |
135 category_filter = tracing_category_filter.TracingCategoryFilter( | |
136 memory_categories) | |
137 for category in v8_categories: | |
138 category_filter.AddIncludedCategory(category) | |
139 options = timeline_based_measurement.Options(category_filter) | |
140 return options | |
141 | 147 |
petrcermak
2016/04/27 16:22:17
ditto: add extra blank line
ulan
2016/04/28 14:34:35
Done.
| |
142 def SetupBenchmarkDefaultTraceRerunOptions(self, tbm_options): | 148 # Disabled on reference builds because they don't support the new |
143 tbm_options.SetLegacyTimelineBasedMetrics(( | 149 # Tracing.requestMemoryDump DevTools API. |
144 v8_gc_latency.V8GCLatency(), | 150 # For 'reference' see http://crbug.com/540022. |
145 memory_timeline.MemoryTimelineMetric(), | 151 # For 'android' see http://crbug.com/579546. |
146 )) | 152 @benchmark.Disabled('reference', 'android') |
153 class MemoryLongRunningIdleGmailBackground(_MemoryV8Benchmark): | |
154 """Use (recorded) real world web sites and measure memory consumption | |
155 of long running idle Gmail page """ | |
156 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet | |
147 | 157 |
148 @classmethod | 158 @classmethod |
149 def Name(cls): | 159 def Name(cls): |
150 return 'memory.long_running_idle_gmail_tbm' | 160 return 'memory.long_running_idle_gmail_background_tbmv2' |
151 | |
152 @classmethod | |
153 def ShouldTearDownStateAfterEachStoryRun(cls): | |
154 return True | |
OLD | NEW |