OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/python | |
2 # Copyright 2015 the V8 project authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can be | |
4 # found in the LICENSE file. | |
5 | |
6 # Script to re-generate SimdJs.json from a SimdJs.json.template. | |
7 | |
8 import json | |
9 import os | |
10 import re | |
11 | |
12 SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) | |
13 | |
14 SKIP_FILES = [ | |
15 '../ecmascript_simd', | |
16 'base', | |
17 # TODO(bradnelson): Drop these when tests are fixed upstream. | |
18 'aobench', | |
19 'averageFloat32x4Load', | |
20 'matrix-multiplication-load', | |
21 ] | |
22 | |
23 run_js = open( | |
24 os.path.join(SCRIPT_DIR, 'data', 'src', 'benchmarks', 'run.js')).read() | |
25 tests = re.findall("load \\(\\'([^']+)[.]js\\'\\)", run_js) | |
26 tests = [t for t in tests if t not in SKIP_FILES] | |
27 | |
28 output = { | |
29 'name': 'SIMDJS', | |
30 'run_count': 5, | |
31 'units': 'ms', | |
32 'total': True, | |
33 'resources': [ | |
34 'test/simdjs/data/src/benchmarks/base.js', | |
35 'test/simdjs/data/src/ecmascript_simd.js' | |
36 ] + ['test/simdjs/data/src/benchmarks/%s.js' % t for t in tests], | |
37 'flags': ['--harmony-object', 'test/simdjs/harness-adapt.js'], | |
38 'path': ['../../'], | |
39 'tests': [ | |
40 { | |
41 'name': test, | |
42 'main': 'test/simdjs/harness-finish.js', | |
43 'flags': ['test/simdjs/data/src/benchmarks/%s.js' % test], | |
44 'results_regexp': '%s\\([ ]*([0-9.]+)(ms)?\\)', | |
45 'tests': [ | |
46 {'name': 'SIMD'}, | |
47 {'name': 'Non-SIMD'}, | |
48 {'name': 'Speedup', 'units': 'score'}, | |
49 {'name': 'Iterations', 'units': 'count'} | |
50 ] | |
51 } | |
52 for test in tests], | |
53 } | |
54 | |
55 with open(os.path.join(SCRIPT_DIR, 'SimdJS.json'), 'w') as fh: | |
56 fh.write(json.dumps(output, separators=(',',': '), indent=2)) | |
Michael Achenbach
2015/05/20 12:20:03
Maybe add sort_keys=True to be deterministic...
bradn
2015/05/20 12:25:31
Done.
| |
OLD | NEW |