author | lagergren |
Tue, 22 Apr 2014 14:09:46 +0200 | |
changeset 24743 | 138ee369abd8 |
parent 24740 | 26791be09688 |
child 24749 | 1549c85f8200 |
permissions | -rw-r--r-- |
16147 | 1 |
/* |
16151 | 2 |
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
16147 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
||
24 |
/** |
|
25 |
* @subtest |
|
26 |
*/ |
|
27 |
||
24743
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
28 |
var read = readFully; |
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
29 |
|
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
30 |
function initZlib() { |
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
31 |
zlib = new BenchmarkSuite('zlib', [152815148], [ |
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
32 |
new Benchmark('zlib', false, true, 10, |
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
33 |
runZlib, undefined, tearDownZlib, null, 3)]); |
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
34 |
} |
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
35 |
|
16147 | 36 |
var tests = [ |
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
37 |
{name:"box2d", files:["box2d.js"], suite:"Box2DBenchmark"}, |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
38 |
{name:"code-load", files:["code-load.js"], suite:"CodeLoad"}, |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
39 |
{name:"crypto", files:["crypto.js"], suite:"Crypto"}, |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
40 |
{name:"deltablue", files:["deltablue.js"], suite:"DeltaBlue"}, |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
41 |
{name:"earley-boyer", files:["earley-boyer.js"], suite:"EarleyBoyer"}, |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
42 |
{name:"gbemu", files:["gbemu-part1.js", "gbemu-part2.js"], suite:"GameboyBenchmark"}, |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
43 |
{name:"mandreel", files:["mandreel.js"], suite:"MandreelBenchmark"}, |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
44 |
{name:"navier-stokes", files:["navier-stokes.js"], suite:"NavierStokes"}, |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
45 |
{name:"pdfjs", files:["pdfjs.js"], suite:"PdfJS"}, |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
46 |
{name:"raytrace", files:["raytrace.js"], suite:"RayTrace"}, |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
47 |
{name:"regexp", files:["regexp.js"], suite:"RegExpSuite"}, |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
48 |
{name:"richards", files:["richards.js"], suite:"Richards"}, |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
49 |
{name:"splay", files:["splay.js"], suite:"Splay"}, |
24743
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
50 |
{name:"typescript", files:["typescript.js", "typescript-input.js", "typescript-compiler.js"], suite:"typescript"}, |
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
51 |
//zlib currently disabled - requires read |
24743
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
52 |
{name:"zlib", files:["zlib.js", "zlib-data.js"], suite:"zlib", before:initZlib} |
16147 | 53 |
]; |
54 |
var dir = (typeof(__DIR__) == 'undefined') ? "test/script/basic/" : __DIR__; |
|
55 |
||
56 |
// TODO: why is this path hard coded when it's defined in project properties? |
|
16163
71f4cff209a9
8005940: provide ant targets to get and update external test scripts
sundar
parents:
16151
diff
changeset
|
57 |
var path = dir + "../external/octane/"; |
16147 | 58 |
|
59 |
var runtime = ""; |
|
60 |
var verbose = false; |
|
61 |
||
62 |
var numberOfIterations = 5; |
|
63 |
||
64 |
function endsWith(str, suffix) { |
|
65 |
return str.indexOf(suffix, str.length - suffix.length) !== -1; |
|
66 |
} |
|
67 |
||
16525
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
68 |
function should_compile_only(name) { |
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
69 |
return (typeof compile_only !== 'undefined') |
16525
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
70 |
} |
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
71 |
|
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
72 |
function load_bench(arg) { |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
73 |
|
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
74 |
for (var idx = 0; idx < arg.files.length; idx++) { |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
75 |
var f = arg.files[idx]; |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
76 |
var file = f.split('/'); |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
77 |
var file_name = path + file[file.length - 1]; |
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
78 |
|
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
79 |
var compile_and_return = should_compile_only(file_name); |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
80 |
if (compile_and_return) { |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
81 |
if (typeof compile_only === 'undefined') { //for a run, skip compile onlies, don't even compile them |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
82 |
return true; |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
83 |
} |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
84 |
} |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
85 |
|
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
86 |
print_verbose(arg, "loading '" + arg.name + "' [" + f + "]..."); |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
87 |
load(file_name); |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
88 |
} |
24743
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
89 |
|
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
90 |
if (typeof arg.before !== 'undefined') { |
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
91 |
arg.before(); |
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
92 |
} |
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
93 |
|
16525
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
94 |
if (compile_and_return) { |
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
95 |
print_always(arg, "Compiled OK"); |
16201
889ddb179cdf
8007062: Split Lower up into Lower/Attr/FinalizeTypes. Integrate AccessSpecalizer into FinalizeTypes.
lagergren
parents:
16163
diff
changeset
|
96 |
} |
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
97 |
return !compile_and_return; |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
98 |
|
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
99 |
} |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
100 |
|
24743
138ee369abd8
8033105: Make sure Nashorn test harness can run zlib benchmark
lagergren
parents:
24740
diff
changeset
|
101 |
|
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
102 |
function run_one_benchmark(arg, iters) { |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
103 |
|
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
104 |
if (!load_bench(arg)) { |
16147 | 105 |
return; |
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
106 |
} |
16147 | 107 |
|
108 |
var success = true; |
|
109 |
var current_name; |
|
110 |
||
111 |
if (iters == undefined) { |
|
112 |
iters = numberOfIterations; |
|
113 |
} else { |
|
114 |
numberOfIterations = iters; |
|
115 |
} |
|
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
116 |
|
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
117 |
var benchmarks = eval(arg.suite + ".benchmarks"); |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
118 |
var min_score = 1e9; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
119 |
var max_score = 0; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
120 |
var mean_score = 0; |
17777
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
121 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
122 |
try { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
123 |
for (var x = 0; x < benchmarks.length ; x++) { |
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
124 |
//do warmup run |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
125 |
//reset random number generator needed as of octane 9 before each run |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
126 |
BenchmarkSuite.ResetRNG(); |
17777
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
127 |
benchmarks[x].Setup(); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
128 |
} |
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
129 |
BenchmarkSuite.ResetRNG(); |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
130 |
print_verbose(arg, "running '" + arg.name + "' for " + iters + " iterations of no less than " + min_time + " seconds (" + runtime + ")"); |
17777
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
131 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
132 |
var scores = []; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
133 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
134 |
var min_time_ms = min_time * 1000; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
135 |
var len = benchmarks.length; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
136 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
137 |
for (var it = 0; it < iters + 1; it++) { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
138 |
//every iteration must take a minimum of 10 secs |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
139 |
var ops = 0; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
140 |
var elapsed = 0; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
141 |
var start = new Date; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
142 |
do { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
143 |
for (var i = 0; i < len; i++) { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
144 |
benchmarks[i].run(); |
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
145 |
//important - no timing here like elapsed = new Date() - start, as in the |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
146 |
//original harness. This will make timing very non-deterministic. |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
147 |
//NOTHING else must live in this loop |
17777
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
148 |
} |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
149 |
ops += len; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
150 |
elapsed = new Date - start; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
151 |
} while (elapsed < min_time * 1000); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
152 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
153 |
var score = ops / elapsed * 1000 * 60; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
154 |
scores.push(score); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
155 |
var name = it == 0 ? "warmup" : "iteration " + it; |
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
156 |
print_verbose(arg, name + " finished " + score.toFixed(0) + " ops/minute"); |
17777
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
157 |
} |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
158 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
159 |
for (var x = 0; x < benchmarks.length ; x++) { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
160 |
benchmarks[x].TearDown(); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
161 |
} |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
162 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
163 |
for (var x = 1; x < iters + 1 ; x++) { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
164 |
mean_score += scores[x]; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
165 |
min_score = Math.min(min_score, scores[x]); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
166 |
max_score = Math.max(max_score, scores[x]); |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
167 |
} |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
168 |
mean_score /= iters; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
169 |
|
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
170 |
} catch (e) { |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
171 |
print_always("*** Aborted and setting score to zero. Reason: " + e); |
24740
26791be09688
8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents:
24719
diff
changeset
|
172 |
if (e instanceof java.lang.Throwable) { |
26791be09688
8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents:
24719
diff
changeset
|
173 |
e.printStackTrace(); |
26791be09688
8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents:
24719
diff
changeset
|
174 |
} |
17777
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
175 |
mean_score = min_score = max_score = 0; |
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
176 |
scores = [0]; |
16147 | 177 |
} |
17777
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
178 |
|
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
179 |
var res = mean_score.toFixed(0); |
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
180 |
if (verbose) { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
181 |
res += " ops/minute (" + min_score.toFixed(0) + "-" + max_score.toFixed(0) + "), warmup=" + scores[0].toFixed(0); |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
182 |
} |
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
183 |
print_always(arg, res); |
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
184 |
} |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
185 |
|
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
186 |
function print_always(arg, x) { |
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
187 |
print("[" + arg.name + "] " + x); |
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
188 |
} |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
189 |
|
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
190 |
function print_verbose(arg, x) { |
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
191 |
if (verbose) { |
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
192 |
print_always(arg, x) |
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
193 |
} |
16147 | 194 |
} |
195 |
||
196 |
function run_suite(tests, iters) { |
|
197 |
for (var idx = 0; idx < tests.length; idx++) { |
|
16525
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16201
diff
changeset
|
198 |
run_one_benchmark(tests[idx], iters); |
16147 | 199 |
} |
200 |
} |
|
201 |
||
202 |
runtime = "command line"; |
|
203 |
||
204 |
var args = []; |
|
17777
3f0a680149b9
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
lagergren
parents:
17774
diff
changeset
|
205 |
|
16147 | 206 |
if (typeof $ARGS !== 'undefined') { |
207 |
args = $ARGS; |
|
208 |
} else if (typeof arguments !== 'undefined' && arguments.length != 0) { |
|
209 |
args = arguments; |
|
210 |
} |
|
211 |
||
212 |
var new_args = []; |
|
213 |
for (i in args) { |
|
214 |
if (args[i].toString().indexOf(' ') != -1) { |
|
215 |
args[i] = args[i].replace(/\/$/, ''); |
|
216 |
var s = args[i].split(' '); |
|
217 |
for (j in s) { |
|
218 |
new_args.push(s[j]); |
|
219 |
} |
|
220 |
} else { |
|
221 |
new_args.push(args[i]); |
|
222 |
} |
|
223 |
} |
|
224 |
||
225 |
if (new_args.length != 0) { |
|
226 |
args = new_args; |
|
227 |
} |
|
228 |
||
229 |
var tests_found = []; |
|
230 |
var iters = undefined; |
|
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
231 |
var min_time = 5; |
16147 | 232 |
|
233 |
for (var i = 0; i < args.length; i++) { |
|
234 |
arg = args[i]; |
|
235 |
if (arg == "--iterations") { |
|
24740
26791be09688
8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents:
24719
diff
changeset
|
236 |
iters = +args[++i]; |
26791be09688
8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents:
24719
diff
changeset
|
237 |
if (isNaN(iters)) { |
26791be09688
8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents:
24719
diff
changeset
|
238 |
throw "'--iterations' must be followed by integer"; |
26791be09688
8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents:
24719
diff
changeset
|
239 |
} |
16147 | 240 |
} else if (arg == "--runtime") { |
241 |
runtime = args[++i]; |
|
242 |
} else if (arg == "--verbose") { |
|
243 |
verbose = true; |
|
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
244 |
} else if (arg == "--min-time") { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
245 |
min_time = +args[++i]; |
24740
26791be09688
8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents:
24719
diff
changeset
|
246 |
if (isNaN(iters)) { |
26791be09688
8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents:
24719
diff
changeset
|
247 |
throw "'--min-time' must be followed by integer"; |
26791be09688
8040089: Apply to call transform was incomplete. Now passes all tests and performance is back
lagergren
parents:
24719
diff
changeset
|
248 |
} |
16147 | 249 |
} else if (arg == "") { |
250 |
continue; //skip |
|
251 |
} else { |
|
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
252 |
var found = false; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
253 |
for (j in tests) { |
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
254 |
if (tests[j].name === arg) { |
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
255 |
tests_found.push(tests[j]); |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
256 |
found = true; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
257 |
break; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
258 |
} |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
259 |
} |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
260 |
if (!found) { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
261 |
var str = "unknown test name: '" + arg + "' -- valid names are: "; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
262 |
for (j in tests) { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
263 |
if (j != 0) { |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
264 |
str += ", "; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
265 |
} |
22384
042ba96233f6
8029780: "ant externals" broke our test harness with the latest version of the octane benchmarks
lagergren
parents:
17777
diff
changeset
|
266 |
str += "'" + tests[j].name + "'"; |
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
267 |
} |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
268 |
throw str; |
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
269 |
} |
16147 | 270 |
} |
271 |
} |
|
272 |
||
273 |
if (tests_found.length == 0) { |
|
274 |
for (i in tests) { |
|
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
275 |
tests_found.push(tests[i]); |
16147 | 276 |
} |
277 |
} |
|
278 |
||
279 |
tests_found.sort(); |
|
280 |
||
17774
0407501fa563
8014219: Make the run-octane harness more deterministic by not measuring elapsed time every iteration. Also got rid of most of the run logic in base.js and call benchmarks directly for the same purpose
lagergren
parents:
16525
diff
changeset
|
281 |
load(path + 'base.js'); |
16147 | 282 |
run_suite(tests_found, iters); |
283 |
||
284 |
||
285 |