Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import os | 4 import os |
| 5 import shlex | 5 import shlex |
| 6 | 6 |
| 7 from core import path_util | 7 from core import path_util |
| 8 from core import perf_benchmark | 8 from core import perf_benchmark |
| 9 from page_sets import google_pages | 9 from page_sets import google_pages |
| 10 | 10 |
| 11 from measurements import v8_detached_context_age_in_gc | 11 from measurements import v8_detached_context_age_in_gc |
| 12 from measurements import v8_gc_times | 12 from measurements import v8_gc_times |
| 13 import page_sets | 13 import page_sets |
| 14 from telemetry import benchmark | 14 from telemetry import benchmark |
| 15 from telemetry import story | 15 from telemetry import story |
| 16 from telemetry.timeline import tracing_category_filter | 16 from telemetry.timeline import tracing_category_filter |
| 17 from telemetry.web_perf import timeline_based_measurement | 17 from telemetry.web_perf import timeline_based_measurement |
| 18 from telemetry.web_perf.metrics import v8_gc_latency | 18 from telemetry.web_perf.metrics import v8_gc_latency |
| 19 from telemetry.web_perf.metrics import v8_execution | 19 from telemetry.web_perf.metrics import v8_execution |
| 20 from telemetry.web_perf.metrics import smoothness | 20 from telemetry.web_perf.metrics import smoothness |
| 21 from telemetry.web_perf.metrics import memory_timeline | 21 from telemetry.web_perf.metrics import memory_timeline |
| 22 | 22 |
| 23 import v8_helper | |
| 23 | 24 |
| 24 def EnableIgnition(options): | 25 |
| 25 existing_js_flags = [] | 26 def CreateV8TimelineBasedMeasurementOptions(benchmark): |
|
nednguyen
2016/04/05 14:43:16
You don't need the benchmark param. Did the pylint
Camillo Bruni
2016/04/06 08:10:25
since I accidentally created v8_helper.py in the c
| |
| 26 for extra_arg in options.extra_browser_args: | 27 category_filter = tracing_category_filter.CreateMinimalOverheadFilter() |
| 27 if extra_arg.startswith('--js-flags='): | 28 category_filter.AddIncludedCategory('v8') |
| 28 existing_js_flags.extend(shlex.split(extra_arg[len('--js-flags='):])) | 29 category_filter.AddIncludedCategory('blink.console') |
| 29 options.AppendExtraBrowserArgs([ | 30 options = timeline_based_measurement.Options(category_filter) |
| 30 # This overrides any existing --js-flags, hence we have to include the | 31 options.SetLegacyTimelineBasedMetrics([v8_execution.V8ExecutionMetric()]) |
| 31 # previous flags as well. | 32 return options |
| 32 '--js-flags=--ignition %s' % (' '.join(existing_js_flags)) | |
| 33 ]) | |
| 34 | 33 |
| 35 | 34 |
| 36 @benchmark.Disabled('win') # crbug.com/416502 | 35 @benchmark.Disabled('win') # crbug.com/416502 |
| 37 class V8Top25(perf_benchmark.PerfBenchmark): | 36 class V8Top25(perf_benchmark.PerfBenchmark): |
| 38 """Measures V8 GC metrics on the while scrolling down the top 25 web pages. | 37 """Measures V8 GC metrics on the while scrolling down the top 25 web pages. |
| 39 | 38 |
| 40 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" | 39 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" |
| 41 test = v8_gc_times.V8GCTimes | 40 test = v8_gc_times.V8GCTimes |
| 42 page_set = page_sets.V8Top25SmoothPageSet | 41 page_set = page_sets.V8Top25SmoothPageSet |
| 43 | 42 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 @classmethod | 135 @classmethod |
| 137 def ShouldTearDownStateAfterEachStoryRun(cls): | 136 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 138 return True | 137 return True |
| 139 | 138 |
| 140 | 139 |
| 141 class V8TodoMVC(perf_benchmark.PerfBenchmark): | 140 class V8TodoMVC(perf_benchmark.PerfBenchmark): |
| 142 """Measures V8 Execution metrics on the TodoMVC examples.""" | 141 """Measures V8 Execution metrics on the TodoMVC examples.""" |
| 143 page_set = page_sets.TodoMVCPageSet | 142 page_set = page_sets.TodoMVCPageSet |
| 144 | 143 |
| 145 def CreateTimelineBasedMeasurementOptions(self): | 144 def CreateTimelineBasedMeasurementOptions(self): |
| 146 category_filter = tracing_category_filter.CreateMinimalOverheadFilter() | 145 return CreateV8TimelineBasedMeasurementOptions(self) |
| 147 category_filter.AddIncludedCategory('v8') | |
| 148 category_filter.AddIncludedCategory('blink.console') | |
| 149 options = timeline_based_measurement.Options(category_filter) | |
| 150 options.SetLegacyTimelineBasedMetrics([v8_execution.V8ExecutionMetric()]) | |
| 151 return options | |
| 152 | 146 |
| 153 @classmethod | 147 @classmethod |
| 154 def Name(cls): | 148 def Name(cls): |
| 155 return 'v8.todomvc' | 149 return 'v8.todomvc' |
| 156 | 150 |
| 157 @classmethod | 151 @classmethod |
| 158 def ShouldTearDownStateAfterEachStoryRun(cls): | 152 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 159 return True | 153 return True |
| 160 | 154 |
| 161 | 155 |
| 162 @benchmark.Disabled('reference') # https://crbug.com/598096 | |
| 163 class V8TodoMVCIgnition(perf_benchmark.PerfBenchmark): | |
| 164 """Measures V8 Execution metrics on the TodoMVC examples using ignition.""" | |
| 165 page_set = page_sets.TodoMVCPageSet | |
| 166 | |
| 167 def SetExtraBrowserOptions(self, options): | |
| 168 EnableIgnition(options) | |
| 169 | |
| 170 def CreateTimelineBasedMeasurementOptions(self): | |
| 171 category_filter = tracing_category_filter.CreateMinimalOverheadFilter() | |
| 172 category_filter.AddIncludedCategory('v8') | |
| 173 category_filter.AddIncludedCategory('blink.console') | |
| 174 options = timeline_based_measurement.Options(category_filter) | |
| 175 options.SetLegacyTimelineBasedMetrics([v8_execution.V8ExecutionMetric()]) | |
| 176 return options | |
| 177 | |
| 178 @classmethod | |
| 179 def Name(cls): | |
| 180 return 'v8.todomvc-ignition' | |
| 181 | |
| 182 @classmethod | |
| 183 def ShouldTearDownStateAfterEachStoryRun(cls): | |
| 184 return True | |
| 185 | |
| 186 | |
| 187 # Disabled on reference builds because they don't support the new | 156 # Disabled on reference builds because they don't support the new |
| 188 # Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022. | 157 # Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022. |
| 189 @benchmark.Disabled('reference') # crbug.com/579546 | 158 @benchmark.Disabled('reference') |
| 190 class V8InfiniteScrollIgnition(_InfiniteScrollBenchmark): | 159 class V8TodoMVCIgnition(V8TodoMVC): |
| 191 """Measures V8 GC metrics using Ignition.""" | 160 """Measures V8 Execution metrics on the TodoMVC examples using ignition.""" |
| 192 | 161 page_set = page_sets.TodoMVCPageSet |
| 193 page_set = page_sets.InfiniteScrollPageSet | |
| 194 | 162 |
| 195 def SetExtraBrowserOptions(self, options): | 163 def SetExtraBrowserOptions(self, options): |
| 196 _InfiniteScrollBenchmark.SetExtraBrowserOptions(self,options) | 164 super(V8TodoMVCIgnition, self).SetExtraBrowserOptions(options) |
| 197 EnableIgnition(options) | 165 v8_helper.EnableIgnition(options) |
| 198 | 166 |
| 199 @classmethod | 167 @classmethod |
| 200 def Name(cls): | 168 def Name(cls): |
| 201 return 'v8.infinite_scroll-ignition' | 169 return 'v8.todomvc-ignition' |
| 202 | 170 |
| 203 | 171 |
| 204 # Disabled on reference builds because they don't support the new | 172 # Disabled on reference builds because they don't support the new |
| 205 # Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022. | 173 # Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022. |
| 206 @benchmark.Disabled('reference') | 174 @benchmark.Disabled('reference') |
| 207 class V8InfiniteScroll(_InfiniteScrollBenchmark): | 175 class V8InfiniteScroll(_InfiniteScrollBenchmark): |
| 208 """Measures V8 GC metrics and memory usage while scrolling the top web pages. | 176 """Measures V8 GC metrics and memory usage while scrolling the top web pages. |
| 209 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" | 177 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" |
| 210 | 178 |
| 211 page_set = page_sets.InfiniteScrollPageSet | 179 page_set = page_sets.InfiniteScrollPageSet |
| 212 | 180 |
| 213 @classmethod | 181 @classmethod |
| 214 def Name(cls): | 182 def Name(cls): |
| 215 return 'v8.infinite_scroll' | 183 return 'v8.infinite_scroll' |
| 216 | 184 |
| 217 | 185 |
| 186 # Disabled on reference builds because they don't support the new | |
| 187 # Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022. | |
| 188 @benchmark.Disabled('reference') # crbug.com/579546 | |
| 189 class V8InfiniteScrollIgnition(V8InfiniteScroll): | |
| 190 """Measures V8 GC metrics using Ignition.""" | |
| 191 | |
| 192 def SetExtraBrowserOptions(self, options): | |
| 193 super(V8InfiniteScrollIgnition, self).SetExtraBrowserOptions(options) | |
| 194 v8_helper.EnableIgnition(options) | |
| 195 | |
| 196 @classmethod | |
| 197 def Name(cls): | |
| 198 return 'v8.infinite_scroll-ignition' | |
| 199 | |
| 200 | |
| 218 @benchmark.Enabled('android') | 201 @benchmark.Enabled('android') |
| 219 class V8MobileInfiniteScroll(_InfiniteScrollBenchmark): | 202 class V8MobileInfiniteScroll(_InfiniteScrollBenchmark): |
| 220 """Measures V8 GC metrics and memory usage while scrolling the top mobile | 203 """Measures V8 GC metrics and memory usage while scrolling the top mobile |
| 221 web pages. | 204 web pages. |
| 222 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" | 205 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" |
| 223 | 206 |
| 224 page_set = page_sets.MobileInfiniteScrollPageSet | 207 page_set = page_sets.MobileInfiniteScrollPageSet |
| 225 | 208 |
| 226 @classmethod | 209 @classmethod |
| 227 def Name(cls): | 210 def Name(cls): |
| 228 return 'v8.mobile_infinite_scroll' | 211 return 'v8.mobile_infinite_scroll' |
| 229 | 212 |
| 230 @classmethod | 213 @classmethod |
| 231 def ShouldDisable(cls, possible_browser): # http://crbug.com/597656 | 214 def ShouldDisable(cls, possible_browser): # http://crbug.com/597656 |
| 232 return (possible_browser.browser_type == 'reference' and | 215 return (possible_browser.browser_type == 'reference' and |
| 233 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X') | 216 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X') |
| 234 | 217 |
| 235 | 218 |
| 236 class V8Adword(perf_benchmark.PerfBenchmark): | 219 class V8Adword(perf_benchmark.PerfBenchmark): |
| 237 """Measures V8 Execution metrics on the Adword page.""" | 220 """Measures V8 Execution metrics on the Adword page.""" |
| 238 | 221 |
| 239 def CreateTimelineBasedMeasurementOptions(self): | 222 def CreateTimelineBasedMeasurementOptions(self): |
| 240 | 223 return CreateV8TimelineBasedMeasurementOptions(self) |
| 241 category_filter = tracing_category_filter.CreateMinimalOverheadFilter() | |
| 242 category_filter.AddIncludedCategory('v8') | |
| 243 category_filter.AddIncludedCategory('blink.console') | |
| 244 options = timeline_based_measurement.Options(category_filter) | |
| 245 options.SetLegacyTimelineBasedMetrics([v8_execution.V8ExecutionMetric()]) | |
| 246 return options | |
| 247 | 224 |
| 248 def CreateStorySet(self, options): | 225 def CreateStorySet(self, options): |
| 249 """Creates the instance of StorySet used to run the benchmark. | 226 """Creates the instance of StorySet used to run the benchmark. |
| 250 | 227 |
| 251 Can be overridden by subclasses. | 228 Can be overridden by subclasses. |
| 252 """ | 229 """ |
| 253 story_set = story.StorySet( | 230 story_set = story.StorySet( |
| 254 archive_data_file=os.path.join( | 231 archive_data_file=os.path.join( |
| 255 path_util.GetPerfStorySetsDir(), 'data', 'v8_pages.json'), | 232 path_util.GetPerfStorySetsDir(), 'data', 'v8_pages.json'), |
| 256 cloud_storage_bucket=story.PARTNER_BUCKET) | 233 cloud_storage_bucket=story.PARTNER_BUCKET) |
| 257 story_set.AddStory(google_pages.AdwordCampaignDesktopPage(story_set)) | 234 story_set.AddStory(google_pages.AdwordCampaignDesktopPage(story_set)) |
| 258 return story_set | 235 return story_set |
| 259 | 236 |
| 260 @classmethod | 237 @classmethod |
| 261 def Name(cls): | 238 def Name(cls): |
| 262 return 'v8.google' | 239 return 'v8.google' |
| 263 | 240 |
| 264 @classmethod | 241 @classmethod |
| 265 def ShouldDisable(cls, possible_browser): | 242 def ShouldDisable(cls, possible_browser): |
| 266 return cls.IsSvelte(possible_browser) # http://crbug.com/596556 | 243 return cls.IsSvelte(possible_browser) # http://crbug.com/596556 |
| 267 | 244 |
| 268 @classmethod | 245 @classmethod |
| 269 def ShouldTearDownStateAfterEachStoryRun(cls): | 246 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 270 return True | 247 return True |
| OLD | NEW |