OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """ | 6 """ |
7 Performance runner for d8. | 7 Performance runner for d8. |
8 | 8 |
9 Call e.g. with tools/run-benchmarks.py --arch ia32 some_suite.json | 9 Call e.g. with tools/run-benchmarks.py --arch ia32 some_suite.json |
10 | 10 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 self.run_count = suite.get("run_count", parent.run_count) | 185 self.run_count = suite.get("run_count", parent.run_count) |
186 self.run_count = suite.get("run_count_%s" % arch, self.run_count) | 186 self.run_count = suite.get("run_count_%s" % arch, self.run_count) |
187 self.units = suite.get("units", parent.units) | 187 self.units = suite.get("units", parent.units) |
188 | 188 |
189 # A regular expression for results. If the parent graph provides a | 189 # A regular expression for results. If the parent graph provides a |
190 # regexp and the current suite has none, a string place holder for the | 190 # regexp and the current suite has none, a string place holder for the |
191 # suite name is expected. | 191 # suite name is expected. |
192 # TODO(machenbach): Currently that makes only sense for the leaf level. | 192 # TODO(machenbach): Currently that makes only sense for the leaf level. |
193 # Multiple place holders for multiple levels are not supported. | 193 # Multiple place holders for multiple levels are not supported. |
194 if parent.results_regexp: | 194 if parent.results_regexp: |
195 regexp_default = parent.results_regexp % suite["name"] | 195 regexp_default = parent.results_regexp % re.escape(suite["name"]) |
196 else: | 196 else: |
197 regexp_default = None | 197 regexp_default = None |
198 self.results_regexp = suite.get("results_regexp", regexp_default) | 198 self.results_regexp = suite.get("results_regexp", regexp_default) |
199 | 199 |
200 # A similar regular expression for the standard deviation (optional). | 200 # A similar regular expression for the standard deviation (optional). |
201 if parent.stddev_regexp: | 201 if parent.stddev_regexp: |
202 stddev_default = parent.stddev_regexp % suite["name"] | 202 stddev_default = parent.stddev_regexp % re.escape(suite["name"]) |
203 else: | 203 else: |
204 stddev_default = None | 204 stddev_default = None |
205 self.stddev_regexp = suite.get("stddev_regexp", stddev_default) | 205 self.stddev_regexp = suite.get("stddev_regexp", stddev_default) |
206 | 206 |
207 | 207 |
208 class Trace(Graph): | 208 class Trace(Graph): |
209 """Represents a leaf in the benchmark suite tree structure. | 209 """Represents a leaf in the benchmark suite tree structure. |
210 | 210 |
211 Handles collection of measurements. | 211 Handles collection of measurements. |
212 """ | 212 """ |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 | 412 |
413 if options.json_test_results: | 413 if options.json_test_results: |
414 results.WriteToFile(options.json_test_results) | 414 results.WriteToFile(options.json_test_results) |
415 else: # pragma: no cover | 415 else: # pragma: no cover |
416 print results | 416 print results |
417 | 417 |
418 return min(1, len(results.errors)) | 418 return min(1, len(results.errors)) |
419 | 419 |
420 if __name__ == "__main__": # pragma: no cover | 420 if __name__ == "__main__": # pragma: no cover |
421 sys.exit(Main(sys.argv[1:])) | 421 sys.exit(Main(sys.argv[1:])) |
OLD | NEW |