Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 benchmarks import v8_helper | 7 from benchmarks import v8_helper |
| 8 from core import perf_benchmark | 8 from core import perf_benchmark |
| 9 from telemetry import benchmark | 9 from telemetry import benchmark |
| 10 from telemetry.timeline import chrome_trace_config | 10 from telemetry.timeline import chrome_trace_config |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 return ('renderer_processes' in value.name and | 79 return ('renderer_processes' in value.name and |
| 80 not _IGNORED_MEMORY_STATS_RE.search(value.name)) | 80 not _IGNORED_MEMORY_STATS_RE.search(value.name)) |
| 81 return (_V8_GC_HIGH_LEVEL_STATS_RE.search(value.name) and | 81 return (_V8_GC_HIGH_LEVEL_STATS_RE.search(value.name) and |
| 82 not _IGNORED_V8_STATS_RE.search(value.name)) | 82 not _IGNORED_V8_STATS_RE.search(value.name)) |
| 83 | 83 |
| 84 @classmethod | 84 @classmethod |
| 85 def ShouldTearDownStateAfterEachStoryRun(cls): | 85 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 86 return True | 86 return True |
| 87 | 87 |
| 88 | 88 |
| 89 class _V8RuntimeStatsBrowsingBenchmark(perf_benchmark.PerfBenchmark): | |
| 90 """Base class for V8 browsing benchmarks that measure RuntimeStats. | |
| 91 RuntimeStats measure the time spent by v8 in different phases like | |
| 92 compile, JS execute, runtime etc., | |
| 93 See browsing_stories._BrowsingStory for workload description. | |
| 94 """ | |
| 95 | |
| 96 def CreateTimelineBasedMeasurementOptions(self): | |
| 97 categories = [ | |
| 98 # Disable all categories by default. | |
| 99 '-*', | |
| 100 # Memory categories. | |
| 101 'disabled-by-default-memory-infra', | |
| 102 # UE categories | |
| 103 'rail', | |
| 104 # V8 categories. | |
| 105 'blink.console', | |
| 106 'disabled-by-default-v8.gc', | |
| 107 'renderer.scheduler', | |
| 108 'v8', | |
| 109 'webkit.console', | |
| 110 'disabled-by-default-v8.runtime_stats', | |
| 111 # TODO(crbug.com/616441, primiano): Remove this temporary workaround, | |
| 112 # which enables memory-infra V8 code stats in V8 code size benchmarks | |
| 113 # only (to not slow down detailed memory dumps in other benchmarks). | |
| 114 'disabled-by-default-memory-infra.v8.code_stats', | |
| 115 ] | |
|
mythria
2017/02/14 16:05:34
Ulan, can I remove any of these categories that ar
mythria
2017/02/16 15:48:25
Had a offline discussion with Ulan and removed dis
| |
| 116 options = timeline_based_measurement.Options( | |
| 117 chrome_trace_category_filter.ChromeTraceCategoryFilter( | |
| 118 ','.join(categories))) | |
| 119 options.config.enable_android_graphics_memtrack = True | |
| 120 # Trigger periodic light memory dumps every 1000 ms. | |
| 121 memory_dump_config = chrome_trace_config.MemoryDumpConfig() | |
| 122 memory_dump_config.AddTrigger('light', 1000) | |
| 123 options.config.chrome_trace_config.SetMemoryDumpConfig(memory_dump_config) | |
| 124 | |
| 125 options.SetTimelineBasedMetrics(['runtimeStatsTotalMetric', 'gcMetric']) | |
| 126 return options | |
| 127 | |
| 128 def CreateStorySet(self, options): | |
| 129 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, case='browse') | |
| 130 | |
| 131 @classmethod | |
| 132 def Name(cls): | |
| 133 return 'v8.runtimestats.browsing_%s%s' % (cls.PLATFORM, cls.TEST_SUFFIX) | |
| 134 | |
| 135 @classmethod | |
| 136 def ShouldTearDownStateAfterEachStoryRun(cls): | |
| 137 return True | |
| 138 | |
| 139 | |
| 89 class _V8DesktopBrowsingBenchmark(_V8BrowsingBenchmark): | 140 class _V8DesktopBrowsingBenchmark(_V8BrowsingBenchmark): |
| 90 | 141 |
| 91 @classmethod | 142 @classmethod |
| 92 def ShouldDisable(cls, possible_browser): | 143 def ShouldDisable(cls, possible_browser): |
| 93 # http://crbug.com/628736 | 144 # http://crbug.com/628736 |
| 94 if (possible_browser.platform.GetOSName() == 'mac' and | 145 if (possible_browser.platform.GetOSName() == 'mac' and |
| 95 possible_browser.browser_type == 'reference'): | 146 possible_browser.browser_type == 'reference'): |
| 96 return True | 147 return True |
| 97 | 148 |
| 98 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' | 149 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 | 199 |
| 149 | 200 |
| 150 @benchmark.Disabled('reference') # http://crbug.com/628631 | 201 @benchmark.Disabled('reference') # http://crbug.com/628631 |
| 151 class V8MobileTurboBrowsingBenchmark(_V8MobileBrowsingBenchmark): | 202 class V8MobileTurboBrowsingBenchmark(_V8MobileBrowsingBenchmark): |
| 152 PLATFORM = 'mobile' | 203 PLATFORM = 'mobile' |
| 153 TEST_SUFFIX = '_turbo' | 204 TEST_SUFFIX = '_turbo' |
| 154 | 205 |
| 155 def SetExtraBrowserOptions(self, options): | 206 def SetExtraBrowserOptions(self, options): |
| 156 super(V8MobileTurboBrowsingBenchmark, self).SetExtraBrowserOptions( | 207 super(V8MobileTurboBrowsingBenchmark, self).SetExtraBrowserOptions( |
| 157 options) | 208 options) |
| 209 | |
| 210 | |
| 211 class V8RuntimeStatsDesktopBrowsingBenchmark( | |
| 212 _V8RuntimeStatsBrowsingBenchmark): | |
| 213 PLATFORM = 'desktop' | |
| 214 TEST_SUFFIX = '' | |
| 215 | |
| 216 @classmethod | |
| 217 def ShouldDisable(cls, possible_browser): | |
| 218 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' | |
| 219 | |
| 220 | |
| 221 class V8RuntimeStatsDesktopTurboBrowsingBenchmark( | |
| 222 _V8RuntimeStatsBrowsingBenchmark): | |
| 223 PLATFORM = 'desktop' | |
| 224 TEST_SUFFIX = '_turbo' | |
| 225 | |
| 226 def SetExtraBrowserOptions(self, options): | |
| 227 super(V8RuntimeStatsDesktopTurboBrowsingBenchmark, | |
| 228 self).SetExtraBrowserOptions(options) | |
| 158 v8_helper.EnableTurbo(options) | 229 v8_helper.EnableTurbo(options) |
| 230 | |
| 231 @classmethod | |
| 232 def ShouldDisable(cls, possible_browser): | |
| 233 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' | |
| 234 | |
| 235 | |
| 236 class V8RuntimeStatsMobileBrowsingBenchmark( | |
| 237 _V8RuntimeStatsBrowsingBenchmark): | |
| 238 PLATFORM = 'mobile' | |
| 239 TEST_SUFFIX = '' | |
| 240 | |
| 241 def SetExtraBrowserOptions(self, options): | |
| 242 super(V8RuntimeStatsMobileBrowsingBenchmark, | |
| 243 self).SetExtraBrowserOptions(options) | |
| 244 v8_helper.EnableTurbo(options) | |
| 245 | |
| 246 @classmethod | |
| 247 def ShouldDisable(cls, possible_browser): | |
| 248 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' | |
| 249 | |
| 250 | |
| 251 class V8RuntimeStatsMobileTurboBrowsingBenchmark( | |
| 252 _V8RuntimeStatsBrowsingBenchmark): | |
| 253 PLATFORM = 'mobile' | |
| 254 TEST_SUFFIX = '_turbo' | |
| 255 | |
| 256 def SetExtraBrowserOptions(self, options): | |
| 257 super(V8RuntimeStatsMobileTurboBrowsingBenchmark, | |
| 258 self).SetExtraBrowserOptions(options) | |
| 259 v8_helper.EnableTurbo(options) | |
| 260 | |
| 261 @classmethod | |
| 262 def ShouldDisable(cls, possible_browser): | |
| 263 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' | |
| 264 | |
| OLD | NEW |