OLD | NEW |
1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2012 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 """Runs Octane 2.0 javascript benchmark. | 5 """Runs Octane 2.0 javascript benchmark. |
6 | 6 |
7 Octane 2.0 is a modern benchmark that measures a JavaScript engine's performance | 7 Octane 2.0 is a modern benchmark that measures a JavaScript engine's performance |
8 by running a suite of tests representative of today's complex and demanding web | 8 by running a suite of tests representative of today's complex and demanding web |
9 applications. Octane's goal is to measure the performance of JavaScript code | 9 applications. Octane's goal is to measure the performance of JavaScript code |
10 found in large, real-world web applications. | 10 found in large, real-world web applications. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 # Split the results into score and test name. | 110 # Split the results into score and test name. |
111 # results log e.g., "Richards: 18343" | 111 # results log e.g., "Richards: 18343" |
112 score_and_name = output.split(': ', 2) | 112 score_and_name = output.split(': ', 2) |
113 assert len(score_and_name) == 2, \ | 113 assert len(score_and_name) == 2, \ |
114 'Unexpected result format "%s"' % score_and_name | 114 'Unexpected result format "%s"' % score_and_name |
115 if 'Skipped' not in score_and_name[1]: | 115 if 'Skipped' not in score_and_name[1]: |
116 name = score_and_name[0] | 116 name = score_and_name[0] |
117 score = int(score_and_name[1]) | 117 score = int(score_and_name[1]) |
118 results.AddValue(scalar.ScalarValue( | 118 results.AddValue(scalar.ScalarValue( |
119 results.current_page, name, 'score', score, important=False, | 119 results.current_page, name, 'score', score, important=False, |
120 description=DESCRIPTIONS.get(name))) | 120 description=DESCRIPTIONS.get(name), higher_is_better=True)) |
121 | 121 |
122 # Collect all test scores to compute geometric mean. | 122 # Collect all test scores to compute geometric mean. |
123 all_scores.append(score) | 123 all_scores.append(score) |
124 total = statistics.GeometricMean(all_scores) | 124 total = statistics.GeometricMean(all_scores) |
125 results.AddSummaryValue( | 125 results.AddSummaryValue( |
126 scalar.ScalarValue(None, 'Total.Score', 'score', total, | 126 scalar.ScalarValue(None, 'Total.Score', 'score', total, |
127 description='Geometric mean of the scores of each ' | 127 description='Geometric mean of the scores of each ' |
128 'individual benchmark in the Octane ' | 128 'individual benchmark in the Octane ' |
129 'benchmark collection.')) | 129 'benchmark collection.')) |
130 | 130 |
131 | 131 |
132 class Octane(benchmark.Benchmark): | 132 class Octane(benchmark.Benchmark): |
133 """Google's Octane JavaScript benchmark.""" | 133 """Google's Octane JavaScript benchmark.""" |
134 test = _OctaneMeasurement | 134 test = _OctaneMeasurement |
135 | 135 |
136 def CreatePageSet(self, options): | 136 def CreatePageSet(self, options): |
137 ps = page_set.PageSet( | 137 ps = page_set.PageSet( |
138 archive_data_file='../page_sets/data/octane.json', | 138 archive_data_file='../page_sets/data/octane.json', |
139 file_path=os.path.abspath(__file__), | 139 file_path=os.path.abspath(__file__), |
140 bucket=page_set.PUBLIC_BUCKET) | 140 bucket=page_set.PUBLIC_BUCKET) |
141 ps.AddUserStory(page_module.Page( | 141 ps.AddUserStory(page_module.Page( |
142 'http://octane-benchmark.googlecode.com/svn/latest/index.html?auto=1', | 142 'http://octane-benchmark.googlecode.com/svn/latest/index.html?auto=1', |
143 ps, ps.base_dir, make_javascript_deterministic=False)) | 143 ps, ps.base_dir, make_javascript_deterministic=False)) |
144 return ps | 144 return ps |
OLD | NEW |