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 cat_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter() | |
| 98 | |
| 99 # Catagories for getting user expecations. | |
| 100 cat_filter.AddIncludedCategory('rail') | |
| 101 cat_filter.AddIncludedCategory('input') | |
| 102 | |
| 103 # V8 needed categories | |
| 104 cat_filter.AddIncludedCategory('v8') | |
| 105 cat_filter.AddDisabledByDefault('disabled-by-default-v8.runtime_stats') | |
| 106 | |
| 107 tbm_options = timeline_based_measurement.Options( | |
| 108 overhead_level=cat_filter) | |
| 109 tbm_options.SetTimelineBasedMetrics(['runtimeStatsTotalMetric']) | |
|
Camillo Bruni
2017/02/10 12:37:21
Could you add the GC metrics as well here? (I pres
| |
| 110 return tbm_options | |
| 111 | |
| 112 | |
| 113 def CreateStorySet(self, options): | |
| 114 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, case='browse') | |
| 115 | |
| 116 @classmethod | |
| 117 def Name(cls): | |
| 118 return 'v8.runtimestats.browsing_%s%s' % (cls.PLATFORM, cls.TEST_SUFFIX) | |
| 119 | |
| 120 @classmethod | |
| 121 def ShouldTearDownStateAfterEachStoryRun(cls): | |
| 122 return True | |
| 123 | |
| 124 | |
| 89 class _V8DesktopBrowsingBenchmark(_V8BrowsingBenchmark): | 125 class _V8DesktopBrowsingBenchmark(_V8BrowsingBenchmark): |
| 90 | 126 |
| 91 @classmethod | 127 @classmethod |
| 92 def ShouldDisable(cls, possible_browser): | 128 def ShouldDisable(cls, possible_browser): |
| 93 # http://crbug.com/628736 | 129 # http://crbug.com/628736 |
| 94 if (possible_browser.platform.GetOSName() == 'mac' and | 130 if (possible_browser.platform.GetOSName() == 'mac' and |
| 95 possible_browser.browser_type == 'reference'): | 131 possible_browser.browser_type == 'reference'): |
| 96 return True | 132 return True |
| 97 | 133 |
| 98 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' | 134 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 | 184 |
| 149 | 185 |
| 150 @benchmark.Disabled('reference') # http://crbug.com/628631 | 186 @benchmark.Disabled('reference') # http://crbug.com/628631 |
| 151 class V8MobileTurboBrowsingBenchmark(_V8MobileBrowsingBenchmark): | 187 class V8MobileTurboBrowsingBenchmark(_V8MobileBrowsingBenchmark): |
| 152 PLATFORM = 'mobile' | 188 PLATFORM = 'mobile' |
| 153 TEST_SUFFIX = '_turbo' | 189 TEST_SUFFIX = '_turbo' |
| 154 | 190 |
| 155 def SetExtraBrowserOptions(self, options): | 191 def SetExtraBrowserOptions(self, options): |
| 156 super(V8MobileTurboBrowsingBenchmark, self).SetExtraBrowserOptions( | 192 super(V8MobileTurboBrowsingBenchmark, self).SetExtraBrowserOptions( |
| 157 options) | 193 options) |
| 194 | |
| 195 | |
| 196 class _V8RuntimeStatsDesktopBrowsingBenchmark(_V8RuntimeStatsBrowsingBenchmark): | |
| 197 PLATFORM = 'desktop' | |
| 198 | |
| 199 @classmethod | |
| 200 def ShouldDisable(cls, possible_browser): | |
| 201 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' | |
| 202 | |
| 203 | |
| 204 class _V8RuntimeStatsMobileBrowsingBenchmark(_V8RuntimeStatsBrowsingBenchmark): | |
| 205 PLATFORM = 'mobile' | |
| 206 | |
| 207 @classmethod | |
| 208 def ShouldDisable(cls, possible_browser): | |
| 209 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' | |
| 210 | |
| 211 | |
| 212 class V8RuntimeStatsDesktopBrowsingBenchmark( | |
| 213 _V8RuntimeStatsDesktopBrowsingBenchmark): | |
| 214 TEST_SUFFIX = '' | |
| 215 | |
| 216 | |
| 217 class V8RuntimeStatsDesktopTurboBrowsingBenchmark( | |
| 218 _V8RuntimeStatsDesktopBrowsingBenchmark): | |
| 219 TEST_SUFFIX = '_turbo' | |
| 220 | |
| 221 def SetExtraBrowserOptions(self, options): | |
| 222 super(V8RuntimeStatsDesktopTurboBrowsingBenchmark, | |
| 223 self).SetExtraBrowserOptions(options) | |
| 158 v8_helper.EnableTurbo(options) | 224 v8_helper.EnableTurbo(options) |
| 225 | |
| 226 | |
| 227 class V8RuntimeStatsMobileBrowsingBenchmark( | |
| 228 _V8RuntimeStatsMobileBrowsingBenchmark): | |
| 229 TEST_SUFFIX = '' | |
| 230 | |
| 231 def SetExtraBrowserOptions(self, options): | |
| 232 super(V8RuntimeStatsMobileBrowsingBenchmark, | |
| 233 self).SetExtraBrowserOptions(options) | |
| 234 v8_helper.EnableTurbo(options) | |
| 235 | |
| 236 | |
| 237 class V8RuntimeStatsMobileTurboBrowsingBenchmark( | |
| 238 _V8RuntimeStatsMobileBrowsingBenchmark): | |
| 239 TEST_SUFFIX = '_turbo' | |
| 240 | |
| 241 def SetExtraBrowserOptions(self, options): | |
| 242 super(V8RuntimeStatsMobileTurboBrowsingBenchmark, | |
| 243 self).SetExtraBrowserOptions(options) | |
| 244 v8_helper.EnableTurbo(options) | |
| 245 | |
| OLD | NEW |