| OLD | NEW |
| (Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 # TODO(rnephew): Migrate to loading benchmark harness. |
| 6 from core import perf_benchmark |
| 7 import page_sets |
| 8 |
| 9 from telemetry import benchmark |
| 10 from telemetry.page import cache_temperature |
| 11 from telemetry.web_perf import timeline_based_measurement |
| 12 |
| 13 |
| 14 def AugmentOptionsForLoadingMetrics(tbm_options): |
| 15 cat_filter = tbm_options.config.chrome_trace_config.category_filter |
| 16 |
| 17 # "blink.console" is used for marking ranges in |
| 18 # cache_temperature.MarkTelemetryInternal. |
| 19 cat_filter.AddIncludedCategory('blink.console') |
| 20 |
| 21 # "navigation" and "blink.user_timing" are needed to capture core |
| 22 # navigation events. |
| 23 cat_filter.AddIncludedCategory('navigation') |
| 24 cat_filter.AddIncludedCategory('blink.user_timing') |
| 25 |
| 26 # "loading" is needed for first-meaningful-paint computation. |
| 27 cat_filter.AddIncludedCategory('loading') |
| 28 |
| 29 # "toplevel" category is used to capture TaskQueueManager events |
| 30 # necessary to compute time-to-interactive. |
| 31 cat_filter.AddIncludedCategory('toplevel') |
| 32 |
| 33 tbm_options.AddTimelineBasedMetric('loadingMetric') |
| 34 return tbm_options |
| 35 |
| 36 |
| 37 class _OopifBase(perf_benchmark.PerfBenchmark): |
| 38 options = {'pageset_repeat': 2} |
| 39 |
| 40 def CreateTimelineBasedMeasurementOptions(self): |
| 41 tbm_options = timeline_based_measurement.Options() |
| 42 AugmentOptionsForLoadingMetrics(tbm_options) |
| 43 return tbm_options |
| 44 |
| 45 @classmethod |
| 46 def ShouldDisable(cls, possible_browser): |
| 47 # crbug.com/619254 |
| 48 if possible_browser.browser_type == 'reference': |
| 49 return True |
| 50 |
| 51 # crbug.com/616781 |
| 52 if (cls.IsSvelte(possible_browser) or |
| 53 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X' or |
| 54 possible_browser.platform.GetDeviceTypeName() == 'AOSP on BullHead'): |
| 55 return True |
| 56 |
| 57 return False |
| 58 |
| 59 |
| 60 @benchmark.Disabled('reference', 'android') |
| 61 @benchmark.Owner(emails=['nasko@chromium.org']) |
| 62 class PageCyclerV2BasicOopifIsolated(_OopifBase): |
| 63 """ A benchmark measuring performance of out-of-process iframes. """ |
| 64 page_set = page_sets.OopifBasicPageSet |
| 65 |
| 66 @classmethod |
| 67 def Name(cls): |
| 68 return 'page_cycler_v2_site_isolation.basic_oopif' |
| 69 |
| 70 def SetExtraBrowserOptions(self, options): |
| 71 options.AppendExtraBrowserArgs(['--site-per-process']) |
| 72 |
| 73 def CreateStorySet(self, options): |
| 74 return page_sets.OopifBasicPageSet(cache_temperatures=[ |
| 75 cache_temperature.PCV1_COLD, cache_temperature.PCV1_WARM]) |
| 76 |
| 77 |
| 78 @benchmark.Disabled('android') |
| 79 @benchmark.Owner(emails=['nasko@chromium.org']) |
| 80 class PageCyclerV2BasicOopif(_OopifBase): |
| 81 """ A benchmark measuring performance of the out-of-process iframes page |
| 82 set, without running in out-of-process iframes mode.. """ |
| 83 page_set = page_sets.OopifBasicPageSet |
| 84 |
| 85 @classmethod |
| 86 def Name(cls): |
| 87 return 'page_cycler_v2.basic_oopif' |
| 88 |
| 89 def CreateStorySet(self, options): |
| 90 return page_sets.OopifBasicPageSet(cache_temperatures=[ |
| 91 cache_temperature.PCV1_COLD, cache_temperature.PCV1_WARM]) |
| OLD | NEW |