| 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 | |
| 5 | |
| 6 from core import path_util | |
| 7 from core import perf_benchmark | 4 from core import perf_benchmark |
| 8 from page_sets import google_pages | |
| 9 | 5 |
| 10 from benchmarks import v8_helper | 6 from benchmarks import v8_helper |
| 11 | 7 |
| 12 from measurements import v8_detached_context_age_in_gc | 8 from measurements import v8_detached_context_age_in_gc |
| 13 import page_sets | 9 import page_sets |
| 10 |
| 14 from telemetry import benchmark | 11 from telemetry import benchmark |
| 15 from telemetry import story | |
| 16 from telemetry.timeline import chrome_trace_category_filter | 12 from telemetry.timeline import chrome_trace_category_filter |
| 17 from telemetry.timeline import chrome_trace_config | 13 from telemetry.timeline import chrome_trace_config |
| 18 from telemetry.web_perf import timeline_based_measurement | 14 from telemetry.web_perf import timeline_based_measurement |
| 19 | 15 |
| 20 | 16 |
| 21 def CreateV8TimelineBasedMeasurementOptions(): | |
| 22 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter() | |
| 23 category_filter.AddIncludedCategory('v8') | |
| 24 category_filter.AddIncludedCategory('blink.console') | |
| 25 category_filter.AddDisabledByDefault('disabled-by-default-v8.compile') | |
| 26 options = timeline_based_measurement.Options(category_filter) | |
| 27 options.SetTimelineBasedMetrics(['executionMetric']) | |
| 28 return options | |
| 29 | |
| 30 | |
| 31 @benchmark.Owner(emails=['ulan@chromium.org']) | 17 @benchmark.Owner(emails=['ulan@chromium.org']) |
| 32 class V8DetachedContextAgeInGC(perf_benchmark.PerfBenchmark): | 18 class V8DetachedContextAgeInGC(perf_benchmark.PerfBenchmark): |
| 33 """Measures the number of GCs needed to collect a detached context. | 19 """Measures the number of GCs needed to collect a detached context. |
| 34 | 20 |
| 35 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" | 21 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" |
| 36 test = v8_detached_context_age_in_gc.V8DetachedContextAgeInGC | 22 test = v8_detached_context_age_in_gc.V8DetachedContextAgeInGC |
| 37 page_set = page_sets.PageReloadCasesPageSet | 23 page_set = page_sets.PageReloadCasesPageSet |
| 38 | 24 |
| 39 @classmethod | 25 @classmethod |
| 40 def Name(cls): | 26 def Name(cls): |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" | 165 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" |
| 180 | 166 |
| 181 def SetExtraBrowserOptions(self, options): | 167 def SetExtraBrowserOptions(self, options): |
| 182 super(V8MobileInfiniteScrollClassic, self).SetExtraBrowserOptions(options) | 168 super(V8MobileInfiniteScrollClassic, self).SetExtraBrowserOptions(options) |
| 183 v8_helper.EnableClassic(options) | 169 v8_helper.EnableClassic(options) |
| 184 | 170 |
| 185 @classmethod | 171 @classmethod |
| 186 def Name(cls): | 172 def Name(cls): |
| 187 return 'v8.mobile_infinite_scroll-classic_tbmv2' | 173 return 'v8.mobile_infinite_scroll-classic_tbmv2' |
| 188 | 174 |
| 189 @benchmark.Owner(emails=['hablich@chromium.org']) | |
| 190 class V8Adword(perf_benchmark.PerfBenchmark): | |
| 191 """Measures V8 Execution metrics on the Adword page.""" | |
| 192 | |
| 193 options = {'pageset_repeat': 3} | |
| 194 | |
| 195 def CreateTimelineBasedMeasurementOptions(self): | |
| 196 return CreateV8TimelineBasedMeasurementOptions() | |
| 197 | |
| 198 def CreateStorySet(self, options): | |
| 199 """Creates the instance of StorySet used to run the benchmark. | |
| 200 | |
| 201 Can be overridden by subclasses. | |
| 202 """ | |
| 203 story_set = story.StorySet( | |
| 204 archive_data_file=os.path.join( | |
| 205 path_util.GetPerfStorySetsDir(), 'data', 'v8_pages.json'), | |
| 206 cloud_storage_bucket=story.PARTNER_BUCKET) | |
| 207 story_set.AddStory(google_pages.AdwordCampaignDesktopPage(story_set)) | |
| 208 return story_set | |
| 209 | |
| 210 @classmethod | |
| 211 def Name(cls): | |
| 212 return 'v8.google' | |
| 213 | |
| 214 @classmethod | |
| 215 def ShouldDisable(cls, possible_browser): | |
| 216 if cls.IsSvelte(possible_browser): # http://crbug.com/596556 | |
| 217 return True | |
| 218 # http://crbug.com/623576 | |
| 219 if (possible_browser.platform.GetDeviceTypeName() == 'Nexus 5' or | |
| 220 possible_browser.platform.GetDeviceTypeName() == 'Nexus 7'): | |
| 221 return True | |
| 222 return False | |
| 223 | |
| 224 @classmethod | |
| 225 def ShouldTearDownStateAfterEachStoryRun(cls): | |
| 226 return True | |
| 227 | |
| 228 | 175 |
| 229 class _Top25RuntimeStats(perf_benchmark.PerfBenchmark): | 176 class _Top25RuntimeStats(perf_benchmark.PerfBenchmark): |
| 230 options = {'pageset_repeat': 3} | 177 options = {'pageset_repeat': 3} |
| 231 | 178 |
| 232 def CreateTimelineBasedMeasurementOptions(self): | 179 def CreateTimelineBasedMeasurementOptions(self): |
| 233 # TODO(fmeawad): most of the cat_filter information is extracted from | 180 # TODO(fmeawad): most of the cat_filter information is extracted from |
| 234 # page_cycler_v2 TimelineBasedMeasurementOptionsForLoadingMetric because | 181 # page_cycler_v2 TimelineBasedMeasurementOptionsForLoadingMetric because |
| 235 # used by the loadingMetric because the runtimeStatsMetric uses the | 182 # used by the loadingMetric because the runtimeStatsMetric uses the |
| 236 # interactive time calculated internally by the loadingMetric. | 183 # interactive time calculated internally by the loadingMetric. |
| 237 # It is better to share the code so that we can keep them in sync. | 184 # It is better to share the code so that we can keep them in sync. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 Designed to represent a mix between top websites and a set of pages that | 224 Designed to represent a mix between top websites and a set of pages that |
| 278 have unique V8 characteristics. | 225 have unique V8 characteristics. |
| 279 """ | 226 """ |
| 280 | 227 |
| 281 @classmethod | 228 @classmethod |
| 282 def Name(cls): | 229 def Name(cls): |
| 283 return 'v8.runtime_stats.top_25' | 230 return 'v8.runtime_stats.top_25' |
| 284 | 231 |
| 285 def CreateStorySet(self, options): | 232 def CreateStorySet(self, options): |
| 286 return page_sets.V8Top25StorySet() | 233 return page_sets.V8Top25StorySet() |
| OLD | NEW |