Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 core import perf_benchmark | 7 from core import perf_benchmark |
| 8 | 8 |
| 9 from telemetry import benchmark | 9 from telemetry import benchmark |
| 10 from telemetry.timeline import tracing_category_filter | 10 from telemetry.timeline import tracing_category_filter |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 # in third_party/catapult). | 50 # in third_party/catapult). |
| 51 tbm_options.SetTimelineBasedMetric('memoryMetric') | 51 tbm_options.SetTimelineBasedMetric('memoryMetric') |
| 52 else: | 52 else: |
| 53 raise Exception('Unrecognized TBM version: %s' % self.TBM_VERSION) | 53 raise Exception('Unrecognized TBM version: %s' % self.TBM_VERSION) |
| 54 return tbm_options | 54 return tbm_options |
| 55 | 55 |
| 56 | 56 |
| 57 # TODO(bashi): Workaround for http://crbug.com/532075 | 57 # TODO(bashi): Workaround for http://crbug.com/532075 |
| 58 # @benchmark.Enabled('android') shouldn't be needed. | 58 # @benchmark.Enabled('android') shouldn't be needed. |
| 59 @benchmark.Enabled('android') | 59 @benchmark.Enabled('android') |
| 60 class MemoryHealthQuick(_MemoryInfra): | 60 class MemoryBenchmarkTop10Mobile(_MemoryInfra): |
| 61 """Timeline based benchmark for the Memory Health Plan (1 iteration).""" | 61 """Measure foreground/background memory on top 10 mobile page set. |
| 62 page_set = page_sets.MemoryHealthStory | 62 |
| 63 This metric provides memory measurements for the System Health Plan of | |
| 64 Chrome on Android. | |
| 65 """ | |
| 66 page_set = page_sets.MemoryTop10Mobile | |
| 67 options = {'pageset_repeat': 5} | |
| 63 | 68 |
| 64 @classmethod | 69 @classmethod |
| 65 def Name(cls): | 70 def Name(cls): |
| 66 return 'memory.memory_health_quick' | 71 return 'memory.top_10_mobile' |
| 67 | 72 |
| 68 @classmethod | 73 @classmethod |
| 69 def ShouldDisable(cls, possible_browser): | 74 def ShouldDisable(cls, possible_browser): |
| 70 # TODO(crbug.com/586148): Benchmark should not depend on DeskClock app. | 75 # TODO(crbug.com/586148): Benchmark should not depend on DeskClock app. |
| 71 return not possible_browser.platform.CanLaunchApplication( | 76 return not possible_browser.platform.CanLaunchApplication( |
| 72 'com.google.android.deskclock') | 77 'com.google.android.deskclock') |
| 73 | 78 |
| 74 | 79 |
| 75 # Benchmark is disabled by default because it takes too long to run. | 80 # TODO(bashi): Workaround for http://crbug.com/532075 |
| 76 @benchmark.Disabled('all') | 81 # @benchmark.Enabled('android') shouldn't be needed. |
| 77 class MemoryHealthPlan(MemoryHealthQuick): | |
| 78 """Timeline based benchmark for the Memory Health Plan (5 iterations).""" | |
| 79 options = {'pageset_repeat': 5} | |
| 80 | |
| 81 @classmethod | |
| 82 def Name(cls): | |
| 83 return 'memory.memory_health_plan' | |
| 84 | |
| 85 | |
| 86 @benchmark.Enabled('android') | 82 @benchmark.Enabled('android') |
| 87 class TBMv2MemoryBenchmarkTop10Mobile(MemoryHealthQuick): | 83 class TBMv2MemoryBenchmarkTop10Mobile(MemoryBenchmarkTop10Mobile): |
| 88 """Timeline based benchmark for the Memory Health Plan based on TBMv2. | 84 """Measure foreground/background memory on top 10 mobile page set (TBMv2). |
| 89 | 85 |
| 90 This is a temporary benchmark to compare the new TBMv2 memory metric | 86 This is a temporary benchmark to compare the new TBMv2 memory metric |
| 91 (memory_metric.html) with the existing TBMv1 one (memory_timeline.py). Once | 87 (memory_metric.html) with the existing TBMv1 one (memory_timeline.py). Once |
| 92 all issues associated with the TBMv2 metric are resolved, all memory | 88 all issues associated with the TBMv2 metric are resolved, all memory |
| 93 benchmarks (including the ones in this file) will switch to use it instead | 89 benchmarks (including the ones in this file) will switch to use it instead |
| 94 of the TBMv1 metric and this temporary benchmark will be removed. See | 90 of the TBMv1 metric and this temporary benchmark will be removed. See |
| 95 crbug.com/60361. | 91 crbug.com/60361. |
| 96 """ | 92 """ |
| 97 TBM_VERSION = 2 | 93 TBM_VERSION = 2 |
| 98 | 94 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 123 | 119 |
| 124 @classmethod | 120 @classmethod |
| 125 def Name(cls): | 121 def Name(cls): |
| 126 return 'memory.blink_memory_mobile' | 122 return 'memory.blink_memory_mobile' |
| 127 | 123 |
| 128 @classmethod | 124 @classmethod |
| 129 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 125 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 130 return bool(cls._RE_RENDERER_VALUES.match(value.name)) | 126 return bool(cls._RE_RENDERER_VALUES.match(value.name)) |
| 131 | 127 |
| 132 | 128 |
| 133 # Disabled on reference builds because they don't support the new | |
|
perezju
2016/04/29 12:58:06
Ignore this bit, this should happen at https://cod
| |
| 134 # Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022. | |
| 135 @benchmark.Disabled('reference') | |
| 136 class MemoryBenchmarkTop10Mobile(_MemoryInfra): | |
| 137 """Timeline based benchmark for measuring memory on top 10 mobile sites.""" | |
| 138 | |
| 139 page_set = page_sets.MemoryInfraTop10MobilePageSet | |
| 140 | |
| 141 @classmethod | |
| 142 def Name(cls): | |
| 143 return 'memory.top_10_mobile' | |
| 144 | |
| 145 | |
| 146 class _MemoryV8Benchmark(_MemoryInfra): | 129 class _MemoryV8Benchmark(_MemoryInfra): |
| 147 def CreateTimelineBasedMeasurementOptions(self): | 130 def CreateTimelineBasedMeasurementOptions(self): |
| 148 v8_categories = [ | 131 v8_categories = [ |
| 149 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console'] | 132 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console'] |
| 150 memory_categories = ['blink.console', 'disabled-by-default-memory-infra'] | 133 memory_categories = ['blink.console', 'disabled-by-default-memory-infra'] |
| 151 category_filter = tracing_category_filter.TracingCategoryFilter( | 134 category_filter = tracing_category_filter.TracingCategoryFilter( |
| 152 ','.join(['-*'] + v8_categories + memory_categories)) | 135 ','.join(['-*'] + v8_categories + memory_categories)) |
| 153 options = timeline_based_measurement.Options(category_filter) | 136 options = timeline_based_measurement.Options(category_filter) |
| 154 options.SetTimelineBasedMetric('v8AndMemoryMetrics') | 137 options.SetTimelineBasedMetric('v8AndMemoryMetrics') |
| 155 return options | 138 return options |
| 156 | 139 |
| 157 | 140 |
| 158 | |
| 159 # Disabled on reference builds because they don't support the new | 141 # Disabled on reference builds because they don't support the new |
| 160 # Tracing.requestMemoryDump DevTools API. | 142 # Tracing.requestMemoryDump DevTools API. |
| 161 # For 'reference' see http://crbug.com/540022. | 143 # For 'reference' see http://crbug.com/540022. |
| 162 # For 'android' see http://crbug.com/579546. | 144 # For 'android' see http://crbug.com/579546. |
| 163 @benchmark.Disabled('reference', 'android') | 145 @benchmark.Disabled('reference', 'android') |
| 164 class MemoryLongRunningIdleGmail(_MemoryV8Benchmark): | 146 class MemoryLongRunningIdleGmail(_MemoryV8Benchmark): |
| 165 """Use (recorded) real world web sites and measure memory consumption | 147 """Use (recorded) real world web sites and measure memory consumption |
| 166 of long running idle Gmail page """ | 148 of long running idle Gmail page """ |
| 167 page_set = page_sets.LongRunningIdleGmailPageSet | 149 page_set = page_sets.LongRunningIdleGmailPageSet |
| 168 | 150 |
| 169 @classmethod | 151 @classmethod |
| 170 def Name(cls): | 152 def Name(cls): |
| 171 return 'memory.long_running_idle_gmail_tbmv2' | 153 return 'memory.long_running_idle_gmail_tbmv2' |
| 172 | 154 |
| 173 | 155 |
| 174 # Disabled on reference builds because they don't support the new | 156 # Disabled on reference builds because they don't support the new |
| 175 # Tracing.requestMemoryDump DevTools API. | 157 # Tracing.requestMemoryDump DevTools API. |
| 176 # For 'reference' see http://crbug.com/540022. | 158 # For 'reference' see http://crbug.com/540022. |
| 177 # For 'android' see http://crbug.com/579546. | 159 # For 'android' see http://crbug.com/579546. |
| 178 @benchmark.Disabled('reference', 'android') | 160 @benchmark.Disabled('reference', 'android') |
| 179 class MemoryLongRunningIdleGmailBackground(_MemoryV8Benchmark): | 161 class MemoryLongRunningIdleGmailBackground(_MemoryV8Benchmark): |
| 180 """Use (recorded) real world web sites and measure memory consumption | 162 """Use (recorded) real world web sites and measure memory consumption |
| 181 of long running idle Gmail page """ | 163 of long running idle Gmail page """ |
| 182 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet | 164 page_set = page_sets.LongRunningIdleGmailBackgroundPageSet |
| 183 | 165 |
| 184 @classmethod | 166 @classmethod |
| 185 def Name(cls): | 167 def Name(cls): |
| 186 return 'memory.long_running_idle_gmail_background_tbmv2' | 168 return 'memory.long_running_idle_gmail_background_tbmv2' |
| OLD | NEW |