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 core import perf_benchmark | 8 from core import perf_benchmark |
8 from telemetry import benchmark | 9 from telemetry import benchmark |
9 from telemetry.timeline import chrome_trace_config | 10 from telemetry.timeline import chrome_trace_config |
10 from telemetry.timeline import chrome_trace_category_filter | 11 from telemetry.timeline import chrome_trace_category_filter |
11 from telemetry.web_perf import timeline_based_measurement | 12 from telemetry.web_perf import timeline_based_measurement |
12 import page_sets | 13 import page_sets |
13 | 14 |
14 | 15 |
15 # See tr.v.Numeric.getSummarizedScalarNumericsWithNames() | 16 # See tr.v.Numeric.getSummarizedScalarNumericsWithNames() |
16 # https://github.com/catapult-project/catapult/blob/master/tracing/tracing/value
/numeric.html#L323 | 17 # https://github.com/catapult-project/catapult/blob/master/tracing/tracing/value
/numeric.html#L323 |
(...skipping 23 matching lines...) Expand all Loading... |
40 # Disable all categories by default. | 41 # Disable all categories by default. |
41 '-*', | 42 '-*', |
42 # Memory categories. | 43 # Memory categories. |
43 'disabled-by-default-memory-infra', | 44 'disabled-by-default-memory-infra', |
44 # V8 categories. | 45 # V8 categories. |
45 'blink.console', | 46 'blink.console', |
46 'disabled-by-default-v8.gc', | 47 'disabled-by-default-v8.gc', |
47 'renderer.scheduler', | 48 'renderer.scheduler', |
48 'v8', | 49 'v8', |
49 'webkit.console', | 50 'webkit.console', |
| 51 # TODO(crbug.com/616441, primiano): Remove this temporary workaround, |
| 52 # which enables memory-infra V8 code stats in V8 code size benchmarks |
| 53 # only (to not slow down detailed memory dumps in other benchmarks). |
| 54 'disabled-by-default-memory-infra.v8.code_stats', |
50 ] | 55 ] |
51 options = timeline_based_measurement.Options( | 56 options = timeline_based_measurement.Options( |
52 chrome_trace_category_filter.ChromeTraceCategoryFilter( | 57 chrome_trace_category_filter.ChromeTraceCategoryFilter( |
53 ','.join(categories))) | 58 ','.join(categories))) |
54 options.config.enable_android_graphics_memtrack = True | 59 options.config.enable_android_graphics_memtrack = True |
55 # Trigger periodic light memory dumps every 1000 ms. | 60 # Trigger periodic light memory dumps every 1000 ms. |
56 memory_dump_config = chrome_trace_config.MemoryDumpConfig() | 61 memory_dump_config = chrome_trace_config.MemoryDumpConfig() |
57 memory_dump_config.AddTrigger('light', 1000) | 62 memory_dump_config.AddTrigger('light', 1000) |
58 options.config.chrome_trace_config.SetMemoryDumpConfig(memory_dump_config) | 63 options.config.chrome_trace_config.SetMemoryDumpConfig(memory_dump_config) |
59 options.SetTimelineBasedMetrics(['v8AndMemoryMetrics']) | 64 options.SetTimelineBasedMetrics(['v8AndMemoryMetrics']) |
60 return options | 65 return options |
61 | 66 |
62 def CreateStorySet(self, options): | 67 def CreateStorySet(self, options): |
63 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, case='browse') | 68 return page_sets.SystemHealthStorySet(platform=self.PLATFORM, case='browse') |
64 | 69 |
65 @classmethod | 70 @classmethod |
66 def Name(cls): | 71 def Name(cls): |
67 return 'v8.browsing_%s' % cls.PLATFORM | 72 return 'v8.browsing_%s%s' % (cls.PLATFORM, cls.TEST_SUFFIX) |
68 | 73 |
69 @classmethod | 74 @classmethod |
70 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 75 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
71 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard | 76 # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
72 # is able to cope with the data load generated by TBMv2 metrics. | 77 # is able to cope with the data load generated by TBMv2 metrics. |
73 if 'memory:chrome' in value.name: | 78 if 'memory:chrome' in value.name: |
74 return ('renderer_processes' in value.name and | 79 return ('renderer_processes' in value.name and |
75 not _IGNORED_MEMORY_STATS_RE.search(value.name)) | 80 not _IGNORED_MEMORY_STATS_RE.search(value.name)) |
76 return (_V8_GC_HIGH_LEVEL_STATS_RE.search(value.name) and | 81 return (_V8_GC_HIGH_LEVEL_STATS_RE.search(value.name) and |
77 not _IGNORED_V8_STATS_RE.search(value.name)) | 82 not _IGNORED_V8_STATS_RE.search(value.name)) |
78 | 83 |
79 @classmethod | 84 @classmethod |
80 def ShouldTearDownStateAfterEachStoryRun(cls): | 85 def ShouldTearDownStateAfterEachStoryRun(cls): |
81 return True | 86 return True |
82 | 87 |
83 | 88 |
84 class V8DesktopBrowsingBenchmark(_V8BrowsingBenchmark): | 89 class _V8DesktopBrowsingBenchmark(_V8BrowsingBenchmark): |
85 PLATFORM = 'desktop' | |
86 | 90 |
87 @classmethod | 91 @classmethod |
88 def ShouldDisable(cls, possible_browser): | 92 def ShouldDisable(cls, possible_browser): |
89 # http://crbug.com/628736 | 93 # http://crbug.com/628736 |
90 if (possible_browser.platform.GetOSName() == 'mac' and | 94 if (possible_browser.platform.GetOSName() == 'mac' and |
91 possible_browser.browser_type == 'reference'): | 95 possible_browser.browser_type == 'reference'): |
92 return True | 96 return True |
93 | 97 |
94 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' | 98 return possible_browser.platform.GetDeviceTypeName() != 'Desktop' |
95 | 99 |
96 @benchmark.Disabled('reference') # http://crbug.com/628631 | 100 |
97 class V8MobileBrowsingBenchmark(_V8BrowsingBenchmark): | 101 class _V8MobileBrowsingBenchmark(_V8BrowsingBenchmark): |
98 PLATFORM = 'mobile' | |
99 | 102 |
100 @classmethod | 103 @classmethod |
101 def ShouldDisable(cls, possible_browser): | 104 def ShouldDisable(cls, possible_browser): |
102 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' | 105 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' |
| 106 |
| 107 |
| 108 class V8DesktopBrowsingBenchmark(_V8DesktopBrowsingBenchmark): |
| 109 PLATFORM = 'desktop' |
| 110 TEST_SUFFIX = '' |
| 111 |
| 112 |
| 113 @benchmark.Disabled('reference') # http://crbug.com/628631 |
| 114 class V8MobileBrowsingBenchmark(_V8MobileBrowsingBenchmark): |
| 115 PLATFORM = 'mobile' |
| 116 TEST_SUFFIX = '' |
| 117 |
| 118 |
| 119 class V8DesktopIgnitionBrowsingBenchmark(_V8DesktopBrowsingBenchmark): |
| 120 PLATFORM = 'desktop' |
| 121 TEST_SUFFIX = '_ignition' |
| 122 |
| 123 def SetExtraBrowserOptions(self, options): |
| 124 super(V8DesktopIgnitionBrowsingBenchmark, self).SetExtraBrowserOptions( |
| 125 options) |
| 126 v8_helper.EnableIgnition(options) |
| 127 |
| 128 |
| 129 @benchmark.Disabled('reference') # http://crbug.com/628631 |
| 130 class V8MobileIgnitionBrowsingBenchmark(_V8MobileBrowsingBenchmark): |
| 131 PLATFORM = 'mobile' |
| 132 TEST_SUFFIX = '_ignition' |
| 133 |
| 134 def SetExtraBrowserOptions(self, options): |
| 135 super(V8MobileIgnitionBrowsingBenchmark, self).SetExtraBrowserOptions( |
| 136 options) |
| 137 v8_helper.EnableIgnition(options) |
OLD | NEW |