| 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 | 4 |
| 5 import page_sets | 5 import page_sets |
| 6 | 6 |
| 7 from core import perf_benchmark | 7 from core import perf_benchmark |
| 8 from telemetry import benchmark | 8 from telemetry import benchmark |
| 9 from telemetry.page import legacy_page_test | 9 from telemetry.page import legacy_page_test |
| 10 from telemetry.value import scalar | 10 from telemetry.value import scalar |
| 11 from telemetry.value import improvement_direction | 11 from telemetry.value import improvement_direction |
| 12 from telemetry.timeline import chrome_trace_category_filter | 12 from telemetry.timeline import chrome_trace_category_filter |
| 13 from telemetry.timeline import chrome_trace_config |
| 13 from telemetry.web_perf import timeline_based_measurement | 14 from telemetry.web_perf import timeline_based_measurement |
| 14 from telemetry.web_perf.metrics import v8_gc_latency | 15 from telemetry.web_perf.metrics import v8_gc_latency |
| 15 from telemetry.web_perf.metrics import smoothness | 16 from telemetry.web_perf.metrics import smoothness |
| 16 from telemetry.web_perf.metrics import memory_timeline | 17 from telemetry.web_perf.metrics import memory_timeline |
| 17 | 18 |
| 18 | 19 |
| 19 class _OortOnlineMeasurement(legacy_page_test.LegacyPageTest): | 20 class _OortOnlineMeasurement(legacy_page_test.LegacyPageTest): |
| 20 | 21 |
| 21 def __init__(self): | 22 def __init__(self): |
| 22 super(_OortOnlineMeasurement, self).__init__() | 23 super(_OortOnlineMeasurement, self).__init__() |
| (...skipping 29 matching lines...) Expand all Loading... |
| 52 # Disabled on reference builds because they don't support the new | 53 # Disabled on reference builds because they don't support the new |
| 53 # Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022. | 54 # Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022. |
| 54 @benchmark.Disabled('reference') | 55 @benchmark.Disabled('reference') |
| 55 @benchmark.Disabled('android') | 56 @benchmark.Disabled('android') |
| 56 class OortOnlineTBM(perf_benchmark.PerfBenchmark): | 57 class OortOnlineTBM(perf_benchmark.PerfBenchmark): |
| 57 """OortOnline benchmark that measures WebGL and V8 performance. | 58 """OortOnline benchmark that measures WebGL and V8 performance. |
| 58 URL: http://oortonline.gl/#run | 59 URL: http://oortonline.gl/#run |
| 59 Info: http://v8project.blogspot.de/2015/10/jank-busters-part-one.html | 60 Info: http://v8project.blogspot.de/2015/10/jank-busters-part-one.html |
| 60 """ | 61 """ |
| 61 | 62 |
| 62 def SetExtraBrowserOptions(self, options): | |
| 63 options.AppendExtraBrowserArgs([ | |
| 64 # TODO(perezju): Temporary workaround to disable periodic memory dumps. | |
| 65 # See: http://crbug.com/513692 | |
| 66 '--enable-memory-benchmarking', | |
| 67 ]) | |
| 68 | |
| 69 def CreateStorySet(self, options): | 63 def CreateStorySet(self, options): |
| 70 return page_sets.OortOnlineTBMPageSet() | 64 return page_sets.OortOnlineTBMPageSet() |
| 71 | 65 |
| 72 def CreateTimelineBasedMeasurementOptions(self): | 66 def CreateTimelineBasedMeasurementOptions(self): |
| 73 v8_gc_latency_categories = [ | 67 v8_gc_latency_categories = [ |
| 74 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console'] | 68 'blink.console', 'renderer.scheduler', 'v8', 'webkit.console'] |
| 75 smoothness_categories = [ | 69 smoothness_categories = [ |
| 76 'webkit.console', 'blink.console', 'benchmark', 'trace_event_overhead'] | 70 'webkit.console', 'blink.console', 'benchmark', 'trace_event_overhead'] |
| 77 categories = list(set(v8_gc_latency_categories + smoothness_categories)) | 71 categories = list(set(v8_gc_latency_categories + smoothness_categories)) |
| 78 memory_categories = 'blink.console,disabled-by-default-memory-infra' | 72 memory_categories = 'blink.console,disabled-by-default-memory-infra' |
| 79 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter( | 73 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter( |
| 80 memory_categories) | 74 memory_categories) |
| 81 for category in categories: | 75 for category in categories: |
| 82 category_filter.AddIncludedCategory(category) | 76 category_filter.AddIncludedCategory(category) |
| 83 options = timeline_based_measurement.Options(category_filter) | 77 options = timeline_based_measurement.Options(category_filter) |
| 84 options.SetLegacyTimelineBasedMetrics([v8_gc_latency.V8GCLatency(), | 78 options.SetLegacyTimelineBasedMetrics([v8_gc_latency.V8GCLatency(), |
| 85 smoothness.SmoothnessMetric(), | 79 smoothness.SmoothnessMetric(), |
| 86 memory_timeline.MemoryTimelineMetric()]) | 80 memory_timeline.MemoryTimelineMetric()]) |
| 81 # Setting an empty memory dump config disables periodic dumps. |
| 82 options.config.chrome_trace_config.SetMemoryDumpConfig( |
| 83 chrome_trace_config.MemoryDumpConfig()) |
| 87 return options | 84 return options |
| 88 | 85 |
| 89 @classmethod | 86 @classmethod |
| 90 def Name(cls): | 87 def Name(cls): |
| 91 return 'oortonline_tbm' | 88 return 'oortonline_tbm' |
| 92 | 89 |
| 93 @classmethod | 90 @classmethod |
| 94 def ValueCanBeAddedPredicate(cls, value, is_first_result): | 91 def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| 95 if value.tir_label in ['Begin', 'End']: | 92 if value.tir_label in ['Begin', 'End']: |
| 96 return value.name.startswith('memory_') and 'v8_renderer' in value.name | 93 return value.name.startswith('memory_') and 'v8_renderer' in value.name |
| 97 else: | 94 else: |
| 98 return value.tir_label == 'Running' | 95 return value.tir_label == 'Running' |
| OLD | NEW |