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 from core import perf_benchmark | 5 from core import perf_benchmark |
6 | 6 |
7 from benchmarks import silk_flags | 7 from benchmarks import silk_flags |
8 from measurements import power | 8 from measurements import power |
9 import page_sets | 9 import page_sets |
10 from telemetry import benchmark | 10 from telemetry import benchmark |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 page_set = page_sets.Top25PageSet | 140 page_set = page_sets.Top25PageSet |
141 | 141 |
142 def SetExtraBrowserOptions(self, options): | 142 def SetExtraBrowserOptions(self, options): |
143 options.full_performance_mode = False | 143 options.full_performance_mode = False |
144 | 144 |
145 @classmethod | 145 @classmethod |
146 def Name(cls): | 146 def Name(cls): |
147 return 'power.top_25' | 147 return 'power.top_25' |
148 | 148 |
149 def CreateStorySet(self, _): | 149 def CreateStorySet(self, _): |
150 # Exclude techcrunch.com. It is not suitable for this benchmark because it | |
151 # does not consistently become quiescent within 60 seconds. | |
152 stories = self.page_set() | 150 stories = self.page_set() |
153 found = next((x for x in stories if 'techcrunch.com' in x.url), None) | 151 to_remove = [x for x in stories if self.IsPageNotQuiescent(x.url)] |
154 if found: | 152 for story in to_remove: |
155 stories.RemoveStory(found) | 153 stories.RemoveStory(story) |
156 return stories | 154 return stories |
157 | 155 |
156 @staticmethod | |
157 def IsPageNotQuiescent(page_url): | |
158 # Exclude sites not suitable for this benchmark because they do not | |
159 # consistently become quiescent within 60 seconds. | |
160 non_quiescent_urls = [ | |
161 'techcrunch.com', | |
petrcermak
2016/10/03 08:07:51
nit: this should be indented only 2 spaces (-2)
ericrk
2016/10/03 17:47:27
Done.
| |
162 'docs.google.com', | |
163 'plus.google.com' | |
164 ] | |
165 | |
166 return any(url in page_url for url in non_quiescent_urls) | |
167 | |
158 | 168 |
159 @benchmark.Enabled('mac') | 169 @benchmark.Enabled('mac') |
160 class PowerGpuRasterizationTop25(perf_benchmark.PerfBenchmark): | 170 class PowerGpuRasterizationTop25(PowerTop25): |
161 """Top 25 quiescent power test with GPU rasterization enabled.""" | 171 """Top 25 quiescent power test with GPU rasterization enabled.""" |
162 tag = 'gpu_rasterization' | 172 tag = 'gpu_rasterization' |
163 test = power.QuiescentPower | 173 test = power.QuiescentPower |
petrcermak
2016/10/03 08:07:51
you don't need the 'test' and 'page_set' fields he
ericrk
2016/10/03 17:47:27
Done.
| |
164 page_set = page_sets.Top25PageSet | 174 page_set = page_sets.Top25PageSet |
165 | 175 |
166 def SetExtraBrowserOptions(self, options): | 176 def SetExtraBrowserOptions(self, options): |
167 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) | 177 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) |
168 options.full_performance_mode = False | 178 options.full_performance_mode = False |
169 | 179 |
170 @classmethod | 180 @classmethod |
171 def Name(cls): | 181 def Name(cls): |
172 return 'power.gpu_rasterization.top_25' | 182 return 'power.gpu_rasterization.top_25' |
173 | 183 |
174 def CreateStorySet(self, _): | |
175 # Exclude techcrunch.com. It is not suitable for this benchmark because it | |
176 # does not consistently become quiescent within 60 seconds. | |
177 stories = self.page_set() | |
178 found = next((x for x in stories if 'techcrunch.com' in x.url), None) | |
179 if found: | |
180 stories.RemoveStory(found) | |
181 return stories | |
182 | |
183 | 184 |
184 @benchmark.Enabled('mac') | 185 @benchmark.Enabled('mac') |
185 class PowerScrollingTrivialPage(perf_benchmark.PerfBenchmark): | 186 class PowerScrollingTrivialPage(perf_benchmark.PerfBenchmark): |
186 """Measure power consumption for some very simple pages.""" | 187 """Measure power consumption for some very simple pages.""" |
187 test = power.QuiescentPower | 188 test = power.QuiescentPower |
188 page_set = page_sets.MacGpuTrivialPagesStorySet | 189 page_set = page_sets.MacGpuTrivialPagesStorySet |
189 | 190 |
190 @classmethod | 191 @classmethod |
191 def Name(cls): | 192 def Name(cls): |
192 return 'power.trivial_pages' | 193 return 'power.trivial_pages' |
193 | 194 |
194 @benchmark.Enabled('mac') | 195 @benchmark.Enabled('mac') |
195 class PowerSteadyStatePages(perf_benchmark.PerfBenchmark): | 196 class PowerSteadyStatePages(perf_benchmark.PerfBenchmark): |
196 """Measure power consumption for real web sites in steady state (no user | 197 """Measure power consumption for real web sites in steady state (no user |
197 interactions).""" | 198 interactions).""" |
198 test = power.QuiescentPower | 199 test = power.QuiescentPower |
199 page_set = page_sets.IdleAfterLoadingStories | 200 page_set = page_sets.IdleAfterLoadingStories |
200 | 201 |
201 @classmethod | 202 @classmethod |
202 def Name(cls): | 203 def Name(cls): |
203 return 'power.steady_state' | 204 return 'power.steady_state' |
OLD | NEW |