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-perf.py --arch ia32 some_suite.json | 9 Call e.g. with tools/run-perf.py --arch ia32 some_suite.json |
10 | 10 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 return str(self.ToDict()) | 172 return str(self.ToDict()) |
173 | 173 |
174 | 174 |
175 class Measurement(object): | 175 class Measurement(object): |
176 """Represents a series of results of one trace. | 176 """Represents a series of results of one trace. |
177 | 177 |
178 The results are from repetitive runs of the same executable. They are | 178 The results are from repetitive runs of the same executable. They are |
179 gathered by repeated calls to ConsumeOutput. | 179 gathered by repeated calls to ConsumeOutput. |
180 """ | 180 """ |
181 def __init__(self, graphs, units, results_regexp, stddev_regexp): | 181 def __init__(self, graphs, units, results_regexp, stddev_regexp): |
182 self.name = graphs[-1] | 182 self.name = '/'.join(graphs) |
183 self.graphs = graphs | 183 self.graphs = graphs |
184 self.units = units | 184 self.units = units |
185 self.results_regexp = results_regexp | 185 self.results_regexp = results_regexp |
186 self.stddev_regexp = stddev_regexp | 186 self.stddev_regexp = stddev_regexp |
187 self.results = [] | 187 self.results = [] |
188 self.errors = [] | 188 self.errors = [] |
189 self.stddev = "" | 189 self.stddev = "" |
190 | 190 |
191 def ConsumeOutput(self, stdout): | 191 def ConsumeOutput(self, stdout): |
192 try: | 192 try: |
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 | 1072 |
1073 if options.json_test_results_no_patch: | 1073 if options.json_test_results_no_patch: |
1074 results_no_patch.WriteToFile(options.json_test_results_no_patch) | 1074 results_no_patch.WriteToFile(options.json_test_results_no_patch) |
1075 else: # pragma: no cover | 1075 else: # pragma: no cover |
1076 print results_no_patch | 1076 print results_no_patch |
1077 | 1077 |
1078 return min(1, len(results.errors)) | 1078 return min(1, len(results.errors)) |
1079 | 1079 |
1080 if __name__ == "__main__": # pragma: no cover | 1080 if __name__ == "__main__": # pragma: no cover |
1081 sys.exit(Main(sys.argv[1:])) | 1081 sys.exit(Main(sys.argv[1:])) |
OLD | NEW |