| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 from core import perf_benchmark | 5 from core import perf_benchmark |
| 6 | 6 |
| 7 from measurements import page_cycler | 7 from measurements import page_cycler |
| 8 import page_sets | 8 import page_sets |
| 9 from telemetry import benchmark | |
| 10 | 9 |
| 11 | 10 |
| 12 class _PageCycler(perf_benchmark.PerfBenchmark): | 11 class _PageCycler(perf_benchmark.PerfBenchmark): |
| 13 options = {'pageset_repeat': 6} | 12 options = {'pageset_repeat': 6} |
| 14 cold_load_percent = 50 # % of page visits for which a cold load is forced | 13 cold_load_percent = 50 # % of page visits for which a cold load is forced |
| 15 | 14 |
| 16 @classmethod | 15 @classmethod |
| 17 def Name(cls): | 16 def Name(cls): |
| 18 return 'page_cycler' | 17 return 'page_cycler' |
| 19 | 18 |
| 20 @classmethod | 19 @classmethod |
| 21 def AddBenchmarkCommandLineArgs(cls, parser): | 20 def AddBenchmarkCommandLineArgs(cls, parser): |
| 22 parser.add_option('--report-speed-index', | 21 parser.add_option('--report-speed-index', |
| 23 action='store_true', | 22 action='store_true', |
| 24 help='Enable the speed index metric.') | 23 help='Enable the speed index metric.') |
| 25 | 24 |
| 26 @classmethod | 25 @classmethod |
| 27 def ValueCanBeAddedPredicate(cls, _, is_first_result): | 26 def ValueCanBeAddedPredicate(cls, _, is_first_result): |
| 28 return cls.cold_load_percent > 0 or not is_first_result | 27 return cls.cold_load_percent > 0 or not is_first_result |
| 29 | 28 |
| 30 def CreatePageTest(self, options): | 29 def CreatePageTest(self, options): |
| 31 return page_cycler.PageCycler( | 30 return page_cycler.PageCycler( |
| 32 page_repeat=options.page_repeat, | 31 page_repeat=options.page_repeat, |
| 33 pageset_repeat=options.pageset_repeat, | 32 pageset_repeat=options.pageset_repeat, |
| 34 cold_load_percent=self.cold_load_percent, | 33 cold_load_percent=self.cold_load_percent, |
| 35 report_speed_index=options.report_speed_index) | 34 report_speed_index=options.report_speed_index) |
| 36 | 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' |
| 37 | 40 |
| 38 @benchmark.Enabled('chromeos') | 41 |
| 39 class PageCyclerIntlArFaHe(_PageCycler): | 42 class PageCyclerIntlArFaHe(_PageCycler): |
| 40 """Page load time for a variety of pages in Arabic, Farsi and Hebrew. | 43 """Page load time for a variety of pages in Arabic, Farsi and Hebrew. |
| 41 | 44 |
| 42 Runs against pages recorded in April, 2013. | 45 Runs against pages recorded in April, 2013. |
| 43 """ | 46 """ |
| 44 page_set = page_sets.IntlArFaHePageSet | 47 page_set = page_sets.IntlArFaHePageSet |
| 45 | 48 |
| 46 @classmethod | 49 @classmethod |
| 47 def Name(cls): | 50 def Name(cls): |
| 48 return 'page_cycler.intl_ar_fa_he' | 51 return 'page_cycler.intl_ar_fa_he' |
| 49 | 52 |
| 50 | 53 |
| 51 @benchmark.Enabled('chromeos') | |
| 52 class PageCyclerIntlEsFrPtBr(_PageCycler): | 54 class PageCyclerIntlEsFrPtBr(_PageCycler): |
| 53 """Page load time for a pages in Spanish, French and Brazilian Portuguese. | 55 """Page load time for a pages in Spanish, French and Brazilian Portuguese. |
| 54 | 56 |
| 55 Runs against pages recorded in April, 2013. | 57 Runs against pages recorded in April, 2013. |
| 56 """ | 58 """ |
| 57 page_set = page_sets.IntlEsFrPtBrPageSet | 59 page_set = page_sets.IntlEsFrPtBrPageSet |
| 58 | 60 |
| 59 @classmethod | 61 @classmethod |
| 60 def Name(cls): | 62 def Name(cls): |
| 61 return 'page_cycler.intl_es_fr_pt-BR' | 63 return 'page_cycler.intl_es_fr_pt-BR' |
| 62 | 64 |
| 63 | 65 |
| 64 class PageCyclerIntlHiRu(_PageCycler): | 66 class PageCyclerIntlHiRu(_PageCycler): |
| 65 """Page load time benchmark for a variety of pages in Hindi and Russian. | 67 """Page load time benchmark for a variety of pages in Hindi and Russian. |
| 66 | 68 |
| 67 Runs against pages recorded in April, 2013. | 69 Runs against pages recorded in April, 2013. |
| 68 """ | 70 """ |
| 69 page_set = page_sets.IntlHiRuPageSet | 71 page_set = page_sets.IntlHiRuPageSet |
| 70 | 72 |
| 71 @classmethod | 73 @classmethod |
| 72 def Name(cls): | 74 def Name(cls): |
| 73 return 'page_cycler.intl_hi_ru' | 75 return 'page_cycler.intl_hi_ru' |
| 74 | 76 |
| 75 | 77 |
| 76 @benchmark.Enabled('chromeos') | |
| 77 class PageCyclerIntlJaZh(_PageCycler): | 78 class PageCyclerIntlJaZh(_PageCycler): |
| 78 """Page load time benchmark for a variety of pages in Japanese and Chinese. | 79 """Page load time benchmark for a variety of pages in Japanese and Chinese. |
| 79 | 80 |
| 80 Runs against pages recorded in April, 2013. | 81 Runs against pages recorded in April, 2013. |
| 81 """ | 82 """ |
| 82 page_set = page_sets.IntlJaZhPageSet | 83 page_set = page_sets.IntlJaZhPageSet |
| 83 | 84 |
| 84 @classmethod | 85 @classmethod |
| 85 def Name(cls): | 86 def Name(cls): |
| 86 return 'page_cycler.intl_ja_zh' | 87 return 'page_cycler.intl_ja_zh' |
| (...skipping 13 matching lines...) Expand all Loading... |
| 100 """Page load time for a variety of pages in Korean, Thai and Vietnamese. | 101 """Page load time for a variety of pages in Korean, Thai and Vietnamese. |
| 101 | 102 |
| 102 Runs against pages recorded in April, 2013. | 103 Runs against pages recorded in April, 2013. |
| 103 """ | 104 """ |
| 104 page_set = page_sets.IntlKoThViPageSet | 105 page_set = page_sets.IntlKoThViPageSet |
| 105 | 106 |
| 106 @classmethod | 107 @classmethod |
| 107 def Name(cls): | 108 def Name(cls): |
| 108 return 'page_cycler.intl_ko_th_vi' | 109 return 'page_cycler.intl_ko_th_vi' |
| 109 | 110 |
| 110 @classmethod | |
| 111 def ShouldDisable(cls, possible_browser): | |
| 112 # http://crbug.com/597656 (Android Nexus 5X). | |
| 113 # http://crbug.com/605543 (Mac Snow Leopard). | |
| 114 return (possible_browser.browser_type == 'reference' and ( | |
| 115 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X' or | |
| 116 possible_browser.platform.GetOSVersionName() == 'snowleopard')) | |
| 117 | 111 |
| 118 | |
| 119 @benchmark.Disabled('android') # crbug.com/357326 | |
| 120 class PageCyclerToughLayoutCases(_PageCycler): | 112 class PageCyclerToughLayoutCases(_PageCycler): |
| 121 """Page loading for the slowest layouts observed in the Alexa top 1 million. | 113 """Page loading for the slowest layouts observed in the Alexa top 1 million. |
| 122 | 114 |
| 123 Recorded in July 2013. | 115 Recorded in July 2013. |
| 124 """ | 116 """ |
| 125 page_set = page_sets.ToughLayoutCasesPageSet | 117 page_set = page_sets.ToughLayoutCasesPageSet |
| 126 | 118 |
| 127 @classmethod | 119 @classmethod |
| 128 def Name(cls): | 120 def Name(cls): |
| 129 return 'page_cycler.tough_layout_cases' | 121 return 'page_cycler.tough_layout_cases' |
| 130 | 122 |
| 131 | 123 |
| 132 class PageCyclerTypical25(_PageCycler): | 124 class PageCyclerTypical25(_PageCycler): |
| 133 """Page load time benchmark for a 25 typical web pages. | 125 """Page load time benchmark for a 25 typical web pages. |
| 134 | 126 |
| 135 Designed to represent typical, not highly optimized or highly popular web | 127 Designed to represent typical, not highly optimized or highly popular web |
| 136 sites. Runs against pages recorded in June, 2014. | 128 sites. Runs against pages recorded in June, 2014. |
| 137 """ | 129 """ |
| 138 options = {'pageset_repeat': 3} | 130 options = {'pageset_repeat': 3} |
| 139 | 131 |
| 140 @classmethod | 132 @classmethod |
| 141 def ShouldDisable(cls, possible_browser): | |
| 142 if possible_browser.browser_type == 'reference': | |
| 143 if possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X': | |
| 144 return True # http://crbug.com/597656 | |
| 145 if possible_browser.platform.GetOSVersionName() == 'yosemite': | |
| 146 return True # http://crbug.com/634337 | |
| 147 if possible_browser.platform.GetDeviceTypeName() == 'AOSP on BullHead': | |
| 148 return True # http://crbug.com/616781 | |
| 149 return False | |
| 150 | |
| 151 @classmethod | |
| 152 def Name(cls): | 133 def Name(cls): |
| 153 return 'page_cycler.typical_25' | 134 return 'page_cycler.typical_25' |
| 154 | 135 |
| 155 def CreateStorySet(self, options): | 136 def CreateStorySet(self, options): |
| 156 return page_sets.Typical25PageSet(run_no_page_interactions=True) | 137 return page_sets.Typical25PageSet(run_no_page_interactions=True) |
| 157 | 138 |
| 158 | 139 |
| 159 @benchmark.Disabled('reference', 'android') | |
| 160 class PageCyclerBasicOopifIsolated(_PageCycler): | 140 class PageCyclerBasicOopifIsolated(_PageCycler): |
| 161 """ A benchmark measuring performance of out-of-process iframes. """ | 141 """ A benchmark measuring performance of out-of-process iframes. """ |
| 162 page_set = page_sets.OopifBasicPageSet | 142 page_set = page_sets.OopifBasicPageSet |
| 163 | 143 |
| 164 @classmethod | 144 @classmethod |
| 165 def Name(cls): | 145 def Name(cls): |
| 166 return 'page_cycler_site_isolation.basic_oopif' | 146 return 'page_cycler_site_isolation.basic_oopif' |
| 167 | 147 |
| 168 def SetExtraBrowserOptions(self, options): | 148 def SetExtraBrowserOptions(self, options): |
| 169 options.AppendExtraBrowserArgs(['--site-per-process']) | 149 options.AppendExtraBrowserArgs(['--site-per-process']) |
| 170 | 150 |
| 171 | 151 |
| 172 class PageCyclerBasicOopif(_PageCycler): | 152 class PageCyclerBasicOopif(_PageCycler): |
| 173 """ A benchmark measuring performance of the out-of-process iframes page | 153 """ A benchmark measuring performance of the out-of-process iframes page |
| 174 set, without running in out-of-process iframes mode.. """ | 154 set, without running in out-of-process iframes mode.. """ |
| 175 page_set = page_sets.OopifBasicPageSet | 155 page_set = page_sets.OopifBasicPageSet |
| 176 | 156 |
| 177 @classmethod | 157 @classmethod |
| 178 def Name(cls): | 158 def Name(cls): |
| 179 return 'page_cycler.basic_oopif' | 159 return 'page_cycler.basic_oopif' |
| 180 | |
| 181 @classmethod | |
| 182 def ShouldDisable(cls, possible_browser): | |
| 183 return cls.IsSvelte(possible_browser) # http://crbug.com/607657 | |
| OLD | NEW |