| OLD | NEW |
| (Empty) |
| 1 # Copyright 2013 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 | |
| 7 from measurements import page_cycler | |
| 8 import page_sets | |
| 9 | |
| 10 | |
| 11 class _PageCycler(perf_benchmark.PerfBenchmark): | |
| 12 options = {'pageset_repeat': 6} | |
| 13 cold_load_percent = 50 # % of page visits for which a cold load is forced | |
| 14 | |
| 15 @classmethod | |
| 16 def Name(cls): | |
| 17 return 'page_cycler' | |
| 18 | |
| 19 @classmethod | |
| 20 def AddBenchmarkCommandLineArgs(cls, parser): | |
| 21 parser.add_option('--report-speed-index', | |
| 22 action='store_true', | |
| 23 help='Enable the speed index metric.') | |
| 24 | |
| 25 @classmethod | |
| 26 def ValueCanBeAddedPredicate(cls, _, is_first_result): | |
| 27 return cls.cold_load_percent > 0 or not is_first_result | |
| 28 | |
| 29 def CreatePageTest(self, options): | |
| 30 return page_cycler.PageCycler( | |
| 31 page_repeat=options.page_repeat, | |
| 32 pageset_repeat=options.pageset_repeat, | |
| 33 cold_load_percent=self.cold_load_percent, | |
| 34 report_speed_index=options.report_speed_index) | |
| 35 | |
| 36 @classmethod | |
| 37 def ShouldDisable(cls, possible_browser): | |
| 38 # Superseded by page_cycler_v2.py on all other platforms (crbug.com/611329). | |
| 39 return possible_browser.platform.GetOSName() != 'chromeos' | |
| 40 | |
| 41 | |
| 42 class PageCyclerIntlArFaHe(_PageCycler): | |
| 43 """Page load time for a variety of pages in Arabic, Farsi and Hebrew. | |
| 44 | |
| 45 Runs against pages recorded in April, 2013. | |
| 46 """ | |
| 47 page_set = page_sets.IntlArFaHePageSet | |
| 48 | |
| 49 @classmethod | |
| 50 def Name(cls): | |
| 51 return 'page_cycler.intl_ar_fa_he' | |
| 52 | |
| 53 | |
| 54 class PageCyclerIntlEsFrPtBr(_PageCycler): | |
| 55 """Page load time for a pages in Spanish, French and Brazilian Portuguese. | |
| 56 | |
| 57 Runs against pages recorded in April, 2013. | |
| 58 """ | |
| 59 page_set = page_sets.IntlEsFrPtBrPageSet | |
| 60 | |
| 61 @classmethod | |
| 62 def Name(cls): | |
| 63 return 'page_cycler.intl_es_fr_pt-BR' | |
| 64 | |
| 65 | |
| 66 class PageCyclerIntlHiRu(_PageCycler): | |
| 67 """Page load time benchmark for a variety of pages in Hindi and Russian. | |
| 68 | |
| 69 Runs against pages recorded in April, 2013. | |
| 70 """ | |
| 71 page_set = page_sets.IntlHiRuPageSet | |
| 72 | |
| 73 @classmethod | |
| 74 def Name(cls): | |
| 75 return 'page_cycler.intl_hi_ru' | |
| 76 | |
| 77 | |
| 78 class PageCyclerIntlJaZh(_PageCycler): | |
| 79 """Page load time benchmark for a variety of pages in Japanese and Chinese. | |
| 80 | |
| 81 Runs against pages recorded in April, 2013. | |
| 82 """ | |
| 83 page_set = page_sets.IntlJaZhPageSet | |
| 84 | |
| 85 @classmethod | |
| 86 def Name(cls): | |
| 87 return 'page_cycler.intl_ja_zh' | |
| 88 | |
| 89 @classmethod | |
| 90 def ValueCanBeAddedPredicate(cls, value, is_first_result): | |
| 91 # Filter out vm_private_dirty_final_renderer | |
| 92 # crbug.com/551522 | |
| 93 print '**** %s ***' % value.name | |
| 94 filtered_name = ( | |
| 95 'vm_private_dirty_final_renderer.vm_private_dirty_final_renderer') | |
| 96 return (super(PageCyclerIntlJaZh, cls).ValueCanBeAddedPredicate( | |
| 97 value, is_first_result) and value.name != filtered_name) | |
| 98 | |
| 99 | |
| 100 class PageCyclerIntlKoThVi(_PageCycler): | |
| 101 """Page load time for a variety of pages in Korean, Thai and Vietnamese. | |
| 102 | |
| 103 Runs against pages recorded in April, 2013. | |
| 104 """ | |
| 105 page_set = page_sets.IntlKoThViPageSet | |
| 106 | |
| 107 @classmethod | |
| 108 def Name(cls): | |
| 109 return 'page_cycler.intl_ko_th_vi' | |
| 110 | |
| 111 | |
| 112 class PageCyclerToughLayoutCases(_PageCycler): | |
| 113 """Page loading for the slowest layouts observed in the Alexa top 1 million. | |
| 114 | |
| 115 Recorded in July 2013. | |
| 116 """ | |
| 117 page_set = page_sets.ToughLayoutCasesPageSet | |
| 118 | |
| 119 @classmethod | |
| 120 def Name(cls): | |
| 121 return 'page_cycler.tough_layout_cases' | |
| 122 | |
| 123 | |
| 124 class PageCyclerTypical25(_PageCycler): | |
| 125 """Page load time benchmark for a 25 typical web pages. | |
| 126 | |
| 127 Designed to represent typical, not highly optimized or highly popular web | |
| 128 sites. Runs against pages recorded in June, 2014. | |
| 129 """ | |
| 130 options = {'pageset_repeat': 3} | |
| 131 | |
| 132 @classmethod | |
| 133 def Name(cls): | |
| 134 return 'page_cycler.typical_25' | |
| 135 | |
| 136 def CreateStorySet(self, options): | |
| 137 return page_sets.Typical25PageSet(run_no_page_interactions=True) | |
| 138 | |
| 139 | |
| 140 class PageCyclerBasicOopifIsolated(_PageCycler): | |
| 141 """ A benchmark measuring performance of out-of-process iframes. """ | |
| 142 page_set = page_sets.OopifBasicPageSet | |
| 143 | |
| 144 @classmethod | |
| 145 def Name(cls): | |
| 146 return 'page_cycler_site_isolation.basic_oopif' | |
| 147 | |
| 148 def SetExtraBrowserOptions(self, options): | |
| 149 options.AppendExtraBrowserArgs(['--site-per-process']) | |
| 150 | |
| 151 | |
| 152 class PageCyclerBasicOopif(_PageCycler): | |
| 153 """ A benchmark measuring performance of the out-of-process iframes page | |
| 154 set, without running in out-of-process iframes mode.. """ | |
| 155 page_set = page_sets.OopifBasicPageSet | |
| 156 | |
| 157 @classmethod | |
| 158 def Name(cls): | |
| 159 return 'page_cycler.basic_oopif' | |
| OLD | NEW |