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 shlex | 4 import shlex |
| 5 | 5 |
| 6 from core import perf_benchmark | 6 from core import perf_benchmark |
| 7 | 7 |
| 8 from measurements import v8_detached_context_age_in_gc | 8 from measurements import v8_detached_context_age_in_gc |
| 9 from measurements import v8_gc_times | 9 from measurements import v8_gc_times |
| 10 import page_sets | 10 import page_sets |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 | 48 |
| 49 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" | 49 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" |
| 50 test = v8_detached_context_age_in_gc.V8DetachedContextAgeInGC | 50 test = v8_detached_context_age_in_gc.V8DetachedContextAgeInGC |
| 51 page_set = page_sets.PageReloadCasesPageSet | 51 page_set = page_sets.PageReloadCasesPageSet |
| 52 | 52 |
| 53 @classmethod | 53 @classmethod |
| 54 def Name(cls): | 54 def Name(cls): |
| 55 return 'v8.detached_context_age_in_gc' | 55 return 'v8.detached_context_age_in_gc' |
| 56 | 56 |
| 57 | 57 |
| 58 # Disabled on reference builds because they don't support the new | 58 class InfiniteScrollBenchmark(perf_benchmark.PerfBenchmark): |
| 59 # Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022. | 59 """ Base class for infinite scroll benchmarks. |
| 60 @benchmark.Disabled('reference', 'android') # crbug.com/579546 | 60 """ |
| 61 @benchmark.Disabled('win') # https://crbug.com/590747 | |
| 62 class V8InfiniteScroll(perf_benchmark.PerfBenchmark): | |
| 63 """Measures V8 GC metrics and memory usage while scrolling the top web pages. | |
| 64 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" | |
| 65 | |
| 66 page_set = page_sets.InfiniteScrollPageSet | |
| 67 | 61 |
| 68 def SetExtraBrowserOptions(self, options): | 62 def SetExtraBrowserOptions(self, options): |
| 69 existing_js_flags = [] | 63 existing_js_flags = [] |
| 70 for extra_arg in options.extra_browser_args: | 64 for extra_arg in options.extra_browser_args: |
| 71 if extra_arg.startswith('--js-flags='): | 65 if extra_arg.startswith('--js-flags='): |
| 72 existing_js_flags.extend(shlex.split(extra_arg[len('--js-flags='):])) | 66 existing_js_flags.extend(shlex.split(extra_arg[len('--js-flags='):])) |
| 73 options.AppendExtraBrowserArgs([ | 67 options.AppendExtraBrowserArgs([ |
| 74 # TODO(perezju): Temporary workaround to disable periodic memory dumps. | 68 # TODO(perezju): Temporary workaround to disable periodic memory dumps. |
| 75 # See: http://crbug.com/513692 | 69 # See: http://crbug.com/513692 |
| 76 '--enable-memory-benchmarking', | 70 '--enable-memory-benchmarking', |
| 71 # Disable push notifications for Facebook. | |
| 72 '--disable-notifications', | |
| 77 # This overrides any existing --js-flags, hence we have to include the | 73 # This overrides any existing --js-flags, hence we have to include the |
| 78 # previous flags as well. | 74 # previous flags as well. |
| 79 '--js-flags="--heap-growing-percent=10 %s"' % | 75 '--js-flags="--heap-growing-percent=10 %s"' % |
| 80 (' '.join(existing_js_flags)) | 76 (' '.join(existing_js_flags)) |
| 81 ]) | 77 ]) |
| 82 | 78 |
| 83 def CreateTimelineBasedMeasurementOptions(self): | 79 def CreateTimelineBasedMeasurementOptions(self): |
| 84 v8_categories = [ | 80 v8_categories = [ |
| 85 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console'] | 81 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console'] |
| 86 smoothness_categories = [ | 82 smoothness_categories = [ |
| 87 'webkit.console', 'blink.console', 'benchmark', 'trace_event_overhead'] | 83 'webkit.console', 'blink.console', 'benchmark', 'trace_event_overhead'] |
| 88 categories = list(set(v8_categories + smoothness_categories)) | 84 categories = list(set(v8_categories + smoothness_categories)) |
| 89 memory_categories = 'blink.console,disabled-by-default-memory-infra' | 85 memory_categories = 'blink.console,disabled-by-default-memory-infra' |
| 90 category_filter = tracing_category_filter.TracingCategoryFilter( | 86 category_filter = tracing_category_filter.TracingCategoryFilter( |
| 91 memory_categories) | 87 memory_categories) |
| 92 for category in categories: | 88 for category in categories: |
| 93 category_filter.AddIncludedCategory(category) | 89 category_filter.AddIncludedCategory(category) |
| 94 options = timeline_based_measurement.Options(category_filter) | 90 options = timeline_based_measurement.Options(category_filter) |
| 95 options.SetLegacyTimelineBasedMetrics([v8_gc_latency.V8GCLatency(), | 91 options.SetLegacyTimelineBasedMetrics([v8_gc_latency.V8GCLatency(), |
| 96 v8_execution.V8ExecutionMetric(), | 92 v8_execution.V8ExecutionMetric(), |
| 97 smoothness.SmoothnessMetric(), | 93 smoothness.SmoothnessMetric(), |
| 98 memory_timeline.MemoryTimelineMetric()]) | 94 memory_timeline.MemoryTimelineMetric()]) |
| 99 return options | 95 return options |
| 100 | 96 |
| 101 @classmethod | 97 @classmethod |
| 102 def Name(cls): | 98 def ValueCanBeAddedPredicate(cls, value, _): |
| 103 return 'v8.infinite_scroll' | |
| 104 | |
| 105 @classmethod | |
| 106 def ValueCanBeAddedPredicate(cls, value, is_first_result): | |
| 107 if value.tir_label in ['Load', 'Wait']: | 99 if value.tir_label in ['Load', 'Wait']: |
| 108 return (value.name.startswith('v8_') and not | 100 return (value.name.startswith('v8_') and not |
| 109 value.name.startswith('v8_gc')) | 101 value.name.startswith('v8_gc')) |
| 110 if value.tir_label in ['Begin', 'End']: | 102 if value.tir_label in ['Begin', 'End']: |
| 111 return (value.name.startswith('memory_') and | 103 return (value.name.startswith('memory_') and |
| 112 'v8_renderer' in value.name) or \ | 104 'v8_renderer' in value.name) or \ |
| 113 (value.name.startswith('v8_') and not | 105 (value.name.startswith('v8_') and not |
| 114 value.name.startswith('v8_gc')) | 106 value.name.startswith('v8_gc')) |
| 115 else: | 107 else: |
| 116 return value.tir_label == 'Scrolling' | 108 return value.tir_label == 'Scrolling' |
| 117 | 109 |
| 110 | |
| 111 # Disabled on reference builds because they don't support the new | |
| 112 # Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022. | |
| 113 @benchmark.Disabled('reference', 'android') # crbug.com/579546 | |
| 114 @benchmark.Disabled('win') # https://crbug.com/590747 | |
| 115 class V8InfiniteScroll(InfiniteScrollBenchmark): | |
| 116 """Measures V8 GC metrics and memory usage while scrolling the top web pages. | |
| 117 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" | |
| 118 | |
| 119 page_set = page_sets.InfiniteScrollPageSet | |
| 120 | |
| 121 @classmethod | |
| 122 def Name(cls): | |
| 123 return 'v8.infinite_scroll' | |
| 124 | |
| 125 @classmethod | |
| 126 def ValueCanBeAddedPredicate(cls, value, is_first): | |
|
eakuefner
2016/03/09 17:49:08
You shouldn't need to add these overrides; because
ulan
2016/03/10 11:41:23
Done.
| |
| 127 return InfiniteScrollBenchmark.ValueCanBeAddedPredicate(value, is_first) | |
| 128 | |
| 118 @classmethod | 129 @classmethod |
| 119 def ShouldTearDownStateAfterEachStoryRun(cls): | 130 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 120 return True | 131 return True |
| 132 | |
| 133 @benchmark.Enabled('android') | |
| 134 class V8MobileInfiniteScroll(InfiniteScrollBenchmark): | |
| 135 """Measures V8 GC metrics and memory usage while scrolling the top mobile | |
| 136 web pages. | |
| 137 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" | |
| 138 | |
| 139 page_set = page_sets.MobileInfiniteScrollPageSet | |
| 140 | |
| 141 @classmethod | |
| 142 def Name(cls): | |
| 143 return 'v8.mobile_infinite_scroll' | |
| 144 | |
| 145 @classmethod | |
| 146 def ValueCanBeAddedPredicate(cls, value, is_first): | |
| 147 return InfiniteScrollBenchmark.ValueCanBeAddedPredicate(value, is_first) | |
| 148 | |
| 149 @classmethod | |
| 150 def ShouldTearDownStateAfterEachStoryRun(cls): | |
| 151 return True | |
| OLD | NEW |