| 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 """PeaceKeeper benchmark suite. | 5 """PeaceKeeper benchmark suite. |
| 6 | 6 |
| 7 Peacekeeper measures browser's performance by testing its JavaScript | 7 Peacekeeper measures browser's performance by testing its JavaScript |
| 8 functionality. JavaScript is a widely used programming language used in the | 8 functionality. JavaScript is a widely used programming language used in the |
| 9 creation of modern websites to provide features such as animation, navigation, | 9 creation of modern websites to provide features such as animation, navigation, |
| 10 forms and other common requirements. By measuring a browser's ability to handle | 10 forms and other common requirements. By measuring a browser's ability to handle |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 # Calculate geometric mean as the total for the combined tests. | 61 # Calculate geometric mean as the total for the combined tests. |
| 62 combined = merge_values.MergeLikeValuesFromDifferentPages( | 62 combined = merge_values.MergeLikeValuesFromDifferentPages( |
| 63 results.all_page_specific_values, | 63 results.all_page_specific_values, |
| 64 group_by_name_suffix=True) | 64 group_by_name_suffix=True) |
| 65 combined_score = [x for x in combined if x.name == 'Score'][0] | 65 combined_score = [x for x in combined if x.name == 'Score'][0] |
| 66 total = statistics.GeometricMean(combined_score.values) | 66 total = statistics.GeometricMean(combined_score.values) |
| 67 results.AddSummaryValue( | 67 results.AddSummaryValue( |
| 68 scalar.ScalarValue(None, 'Total.Score', 'score', total)) | 68 scalar.ScalarValue(None, 'Total.Score', 'score', total)) |
| 69 | 69 |
| 70 | 70 |
| 71 @benchmark.Disabled |
| 71 class PeaceKeeperBenchmark(benchmark.Benchmark): | 72 class PeaceKeeperBenchmark(benchmark.Benchmark): |
| 72 """A base class for Peackeeper benchmarks.""" | 73 """A base class for Peackeeper benchmarks.""" |
| 73 test = _PeaceKeeperMeasurement | 74 test = _PeaceKeeperMeasurement |
| 74 | 75 |
| 75 def CreatePageSet(self, options): | 76 def CreatePageSet(self, options): |
| 76 """Makes a PageSet for PeaceKeeper benchmarks.""" | 77 """Makes a PageSet for PeaceKeeper benchmarks.""" |
| 77 # Subclasses are expected to define a class member called query_param. | 78 # Subclasses are expected to define a class member called query_param. |
| 78 if not hasattr(self, 'test_param'): | 79 if not hasattr(self, 'test_param'): |
| 79 raise NotImplementedError('test_param not in PeaceKeeper benchmark.') | 80 raise NotImplementedError('test_param not in PeaceKeeper benchmark.') |
| 80 | 81 |
| 81 ps = page_set.PageSet( | 82 ps = page_set.PageSet( |
| 82 archive_data_file='../page_sets/data/peacekeeper_%s.json' % self.tag, | 83 archive_data_file='../page_sets/data/peacekeeper_%s.json' % self.tag, |
| 83 make_javascript_deterministic=False) | 84 make_javascript_deterministic=False) |
| 84 for test_name in self.test_param: | 85 for test_name in self.test_param: |
| 85 ps.AddPageWithDefaultRunNavigate( | 86 ps.AddPageWithDefaultRunNavigate( |
| 86 ('http://peacekeeper.futuremark.com/run.action?debug=true&' | 87 ('http://peacekeeper.futuremark.com/run.action?debug=true&' |
| 87 'repeat=false&forceSuiteName=%s&forceTestName=%s') % | 88 'repeat=false&forceSuiteName=%s&forceTestName=%s') % |
| 88 (self.tag, test_name)) | 89 (self.tag, test_name)) |
| 89 return ps | 90 return ps |
| 90 | 91 |
| 91 | 92 |
| 93 @benchmark.Disabled |
| 92 class PeaceKeeperRender(PeaceKeeperBenchmark): | 94 class PeaceKeeperRender(PeaceKeeperBenchmark): |
| 93 """PeaceKeeper rendering benchmark suite. | 95 """PeaceKeeper rendering benchmark suite. |
| 94 | 96 |
| 95 These tests measure your browser's ability to render and modify specific | 97 These tests measure your browser's ability to render and modify specific |
| 96 elements used in typical web pages. Rendering tests manipulate the DOM tree in | 98 elements used in typical web pages. Rendering tests manipulate the DOM tree in |
| 97 real-time. The tests measure display updating speed (frames per seconds). | 99 real-time. The tests measure display updating speed (frames per seconds). |
| 98 """ | 100 """ |
| 99 tag = 'render' | 101 tag = 'render' |
| 100 test_param = ['renderGrid01', | 102 test_param = ['renderGrid01', |
| 101 'renderGrid02', | 103 'renderGrid02', |
| 102 'renderGrid03', | 104 'renderGrid03', |
| 103 'renderPhysics' | 105 'renderPhysics' |
| 104 ] | 106 ] |
| 105 | 107 |
| 106 | 108 |
| 109 @benchmark.Disabled |
| 107 class PeaceKeeperData(PeaceKeeperBenchmark): | 110 class PeaceKeeperData(PeaceKeeperBenchmark): |
| 108 """PeaceKeeper Data operations benchmark suite. | 111 """PeaceKeeper Data operations benchmark suite. |
| 109 | 112 |
| 110 These tests measure your browser's ability to add, remove and modify data | 113 These tests measure your browser's ability to add, remove and modify data |
| 111 stored in an array. The Data suite consists of two tests: | 114 stored in an array. The Data suite consists of two tests: |
| 112 1. arrayCombined: This test uses all features of the JavaScript Array object. | 115 1. arrayCombined: This test uses all features of the JavaScript Array object. |
| 113 This is a technical test that is not based on profiled data. | 116 This is a technical test that is not based on profiled data. |
| 114 The source data are different sized arrays of numbers. | 117 The source data are different sized arrays of numbers. |
| 115 2. arrayWeighted: This test is similar to 'arrayCombined', but the load is | 118 2. arrayWeighted: This test is similar to 'arrayCombined', but the load is |
| 116 balanced based on profiled data. The source data is a list of all the | 119 balanced based on profiled data. The source data is a list of all the |
| 117 countries in the world. | 120 countries in the world. |
| 118 """ | 121 """ |
| 119 | 122 |
| 120 tag = 'array' | 123 tag = 'array' |
| 121 test_param = ['arrayCombined01', | 124 test_param = ['arrayCombined01', |
| 122 'arrayWeighted' | 125 'arrayWeighted' |
| 123 ] | 126 ] |
| 124 | 127 |
| 125 | 128 |
| 129 @benchmark.Disabled |
| 126 class PeaceKeeperDom(PeaceKeeperBenchmark): | 130 class PeaceKeeperDom(PeaceKeeperBenchmark): |
| 127 """PeaceKeeper DOM operations benchmark suite. | 131 """PeaceKeeper DOM operations benchmark suite. |
| 128 | 132 |
| 129 These tests emulate the methods used to create typical dynamic webpages. | 133 These tests emulate the methods used to create typical dynamic webpages. |
| 130 The DOM tests are based on development experience and the capabilities of the | 134 The DOM tests are based on development experience and the capabilities of the |
| 131 jQuery framework. | 135 jQuery framework. |
| 132 1. domGetElements: This test uses native DOM methods getElementById and | 136 1. domGetElements: This test uses native DOM methods getElementById and |
| 133 getElementsByName. The elements are not modified. | 137 getElementsByName. The elements are not modified. |
| 134 2. domDynamicCreationCreateElement: A common use of DOM is to dynamically | 138 2. domDynamicCreationCreateElement: A common use of DOM is to dynamically |
| 135 create content with JavaScript, this test measures creating objects | 139 create content with JavaScript, this test measures creating objects |
| (...skipping 20 matching lines...) Expand all Loading... |
| 156 'domDynamicCreationInnerHTML', | 160 'domDynamicCreationInnerHTML', |
| 157 'domJQueryAttributeFilters', | 161 'domJQueryAttributeFilters', |
| 158 'domJQueryBasicFilters', | 162 'domJQueryBasicFilters', |
| 159 'domJQueryBasics', | 163 'domJQueryBasics', |
| 160 'domJQueryContentFilters', | 164 'domJQueryContentFilters', |
| 161 'domJQueryHierarchy', | 165 'domJQueryHierarchy', |
| 162 'domQueryselector' | 166 'domQueryselector' |
| 163 ] | 167 ] |
| 164 | 168 |
| 165 | 169 |
| 170 @benchmark.Disabled |
| 166 class PeaceKeeperTextParsing(PeaceKeeperBenchmark): | 171 class PeaceKeeperTextParsing(PeaceKeeperBenchmark): |
| 167 """PeaceKeeper Text Parsing benchmark suite. | 172 """PeaceKeeper Text Parsing benchmark suite. |
| 168 | 173 |
| 169 These tests measure your browser's performance in typical text manipulations | 174 These tests measure your browser's performance in typical text manipulations |
| 170 such as using a profanity filter for chats, browser detection and form | 175 such as using a profanity filter for chats, browser detection and form |
| 171 validation. | 176 validation. |
| 172 1. stringChat: This test removes swearing from artificial chat messages. | 177 1. stringChat: This test removes swearing from artificial chat messages. |
| 173 Test measures looping and string replace-method. | 178 Test measures looping and string replace-method. |
| 174 2. stringDetectBrowser: This test uses string indexOf-method to detect browser | 179 2. stringDetectBrowser: This test uses string indexOf-method to detect browser |
| 175 and operating system. | 180 and operating system. |
| 176 3. stringFilter: This test filters a list of movies with a given keyword. | 181 3. stringFilter: This test filters a list of movies with a given keyword. |
| 177 The behaviour is known as filtering select or continuous filter. It's used | 182 The behaviour is known as filtering select or continuous filter. It's used |
| 178 to give real time suggestions while a user is filling input fields. | 183 to give real time suggestions while a user is filling input fields. |
| 179 The test uses simple regular expressions. | 184 The test uses simple regular expressions. |
| 180 4. stringValidateForm: This test uses complex regular expressions to validate | 185 4. stringValidateForm: This test uses complex regular expressions to validate |
| 181 user input. | 186 user input. |
| 182 5. stringWeighted: This is an artificial test. Methods used and their | 187 5. stringWeighted: This is an artificial test. Methods used and their |
| 183 intensities are chosen based on profiled data. | 188 intensities are chosen based on profiled data. |
| 184 """ | 189 """ |
| 185 | 190 |
| 186 tag = 'string' | 191 tag = 'string' |
| 187 test_param = ['stringChat', | 192 test_param = ['stringChat', |
| 188 'stringDetectBrowser', | 193 'stringDetectBrowser', |
| 189 'stringFilter', | 194 'stringFilter', |
| 190 'stringWeighted', | 195 'stringWeighted', |
| 191 'stringValidateForm' | 196 'stringValidateForm' |
| 192 ] | 197 ] |
| 193 | 198 |
| 194 | 199 |
| 200 @benchmark.Disabled |
| 195 class PeaceKeeperHTML5Canvas(PeaceKeeperBenchmark): | 201 class PeaceKeeperHTML5Canvas(PeaceKeeperBenchmark): |
| 196 """PeaceKeeper HTML5 Canvas benchmark suite. | 202 """PeaceKeeper HTML5 Canvas benchmark suite. |
| 197 | 203 |
| 198 These tests use HTML5 Canvas, which is a web technology for drawing and | 204 These tests use HTML5 Canvas, which is a web technology for drawing and |
| 199 manipulating graphics without external plug-ins. | 205 manipulating graphics without external plug-ins. |
| 200 1. experimentalRipple01: Simulates a 'water ripple' effect by using HTML 5 | 206 1. experimentalRipple01: Simulates a 'water ripple' effect by using HTML 5 |
| 201 Canvas. It measures the browser's ability to draw individual pixels. | 207 Canvas. It measures the browser's ability to draw individual pixels. |
| 202 2. experimentalRipple02: Same test as 'experimentalRipple01', but with a | 208 2. experimentalRipple02: Same test as 'experimentalRipple01', but with a |
| 203 larger canvas and thus a heavier workload. | 209 larger canvas and thus a heavier workload. |
| 204 """ | 210 """ |
| 205 | 211 |
| 206 tag = 'experimental' | 212 tag = 'experimental' |
| 207 test_param = ['experimentalRipple01', | 213 test_param = ['experimentalRipple01', |
| 208 'experimentalRipple02' | 214 'experimentalRipple02' |
| 209 ] | 215 ] |
| 210 | 216 |
| 211 | 217 |
| 218 @benchmark.Disabled |
| 212 class PeaceKeeperHTML5Capabilities(PeaceKeeperBenchmark): | 219 class PeaceKeeperHTML5Capabilities(PeaceKeeperBenchmark): |
| 213 """PeaceKeeper HTML5 Capabilities benchmark suite. | 220 """PeaceKeeper HTML5 Capabilities benchmark suite. |
| 214 | 221 |
| 215 These tests checks browser HTML5 capabilities support for WebGL, Video | 222 These tests checks browser HTML5 capabilities support for WebGL, Video |
| 216 foramts, simple 2D sprite based games and web worker. | 223 foramts, simple 2D sprite based games and web worker. |
| 217 This benchmark only tests HTML5 capability and thus is not calculate into the | 224 This benchmark only tests HTML5 capability and thus is not calculate into the |
| 218 overall score. | 225 overall score. |
| 219 1. HTML5 - WebGL: WebGL allows full blown 3D graphics to be rendered in a | 226 1. HTML5 - WebGL: WebGL allows full blown 3D graphics to be rendered in a |
| 220 browser without the need for any external plug-ins. | 227 browser without the need for any external plug-ins. |
| 221 a) webglSphere | 228 a) webglSphere |
| (...skipping 17 matching lines...) Expand all Loading... |
| 239 tag = 'html5' | 246 tag = 'html5' |
| 240 test_param = ['webglSphere', | 247 test_param = ['webglSphere', |
| 241 'gamingSpitfire', | 248 'gamingSpitfire', |
| 242 'videoCodecH264', | 249 'videoCodecH264', |
| 243 'videoCodecTheora', | 250 'videoCodecTheora', |
| 244 'videoCodecWebM', | 251 'videoCodecWebM', |
| 245 'videoPosterSupport', | 252 'videoPosterSupport', |
| 246 'workerContrast01', | 253 'workerContrast01', |
| 247 'workerContrast02' | 254 'workerContrast02' |
| 248 ] | 255 ] |
| OLD | NEW |