OLD | NEW |
(Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 from core import perf_benchmark |
| 6 import page_sets |
| 7 |
| 8 from telemetry import benchmark |
| 9 from telemetry.timeline import tracing_category_filter |
| 10 from telemetry.web_perf import timeline_based_measurement |
| 11 from telemetry.web_perf.metrics import startup |
| 12 |
| 13 |
| 14 class _StartWithUrlTBM(perf_benchmark.PerfBenchmark): |
| 15 """Measures time to start Chrome with startup URLs.""" |
| 16 |
| 17 page_set = page_sets.StartupPagesPageSetTBM |
| 18 |
| 19 @classmethod |
| 20 def Name(cls): |
| 21 # TODO(gabadie): change to start_with_url.* after confirming that both |
| 22 # benchmarks produce the same results. |
| 23 return 'start_with_url2.startup_pages' |
| 24 |
| 25 def SetExtraBrowserOptions(self, options): |
| 26 options.AppendExtraBrowserArgs([ |
| 27 '--enable-stats-collection-bindings' |
| 28 ]) |
| 29 |
| 30 def CreateTimelineBasedMeasurementOptions(self): |
| 31 startup_category_filter = tracing_category_filter.TracingCategoryFilter( |
| 32 filter_string='startup,blink.user_timing') |
| 33 options = timeline_based_measurement.Options( |
| 34 overhead_level=startup_category_filter) |
| 35 options.SetTimelineBasedMetrics( |
| 36 [startup.StartupTimelineMetric()]) |
| 37 return options |
| 38 |
| 39 |
| 40 @benchmark.Enabled('has tabs') |
| 41 @benchmark.Enabled('android') |
| 42 @benchmark.Disabled('chromeos', 'linux', 'mac', 'win') |
| 43 class StartWithUrlColdTBM(_StartWithUrlTBM): |
| 44 """Measures time to start Chrome cold with startup URLs.""" |
| 45 |
| 46 options = {'pageset_repeat': 5} |
| 47 |
| 48 def SetExtraBrowserOptions(self, options): |
| 49 options.clear_sytem_cache_for_browser_and_profile_on_start = True |
| 50 super(StartWithUrlColdTBM, self).SetExtraBrowserOptions(options) |
| 51 |
| 52 @classmethod |
| 53 def Name(cls): |
| 54 return 'start_with_url2.cold.startup_pages' |
| 55 |
| 56 |
| 57 @benchmark.Enabled('has tabs') |
| 58 @benchmark.Enabled('android') |
| 59 @benchmark.Disabled('chromeos', 'linux', 'mac', 'win') |
| 60 class StartWithUrlWarmTBM(_StartWithUrlTBM): |
| 61 """Measures stimetime to start Chrome warm with startup URLs.""" |
| 62 |
| 63 options = {'pageset_repeat': 10} |
| 64 |
| 65 @classmethod |
| 66 def Name(cls): |
| 67 return 'start_with_url2.warm.startup_pages' |
OLD | NEW |