Mercurial > people > rkennke > jdk9-shenandoah-final > nashorn
changeset 297:e6193dcfe36c
8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
Reviewed-by: sundar, jlaskey
author | lagergren |
---|---|
date | Mon, 27 May 2013 17:57:07 +0200 |
parents | 343fd0450802 |
children | d56168970de1 |
files | make/build-benchmark.xml test/script/basic/run-octane.js |
diffstat | 2 files changed, 55 insertions(+), 45 deletions(-) [+] |
line wrap: on
line diff
--- a/make/build-benchmark.xml Mon May 27 20:41:34 2013 +0530 +++ b/make/build-benchmark.xml Mon May 27 17:57:07 2013 +0200 @@ -24,14 +24,13 @@ <project name="nashorn-benchmarks" default="all" basedir=".."> <target name="octane-init" depends="jar"> - <fileset id="octane-set" - dir="${octane-test-sys-prop.test.js.roots}" - excludes="${octane-test-sys-prop.test.js.exclude.list}"> - <include name="*.js"/> - </fileset> - <pathconvert pathsep=" " property="octane-tests" refid="octane-set"/> + <property name="octane-tests" value="box2d code-load crypto deltablue earley-boyer gbemu navier-stokes pdfjs raytrace regexp richards splay"/> </target> - + + <!-- ignore benchmarks where rhino crashes --> + <target name="octane-init-rhino" depends="jar"> + <property name="octane-tests" value="box2d code-load crypto deltablue earley-boyer gbemu navier-stokes raytrace regexp richards splay"/> + </target> <!-- box2d --> <target name="octane-box2d" depends="jar"> @@ -320,7 +319,7 @@ </target> <!-- run octane benchmarks using Rhino as runtime --> - <target name="octane-rhino" depends="octane-init"> + <target name="octane-rhino" depends="octane-init-rhino"> <antcall target="run-octane-rhino"/> </target>
--- a/test/script/basic/run-octane.js Mon May 27 20:41:34 2013 +0530 +++ b/test/script/basic/run-octane.js Mon May 27 17:57:07 2013 +0200 @@ -89,47 +89,57 @@ } var benchmarks = eval(arg.suite + ".benchmarks"); - for (var x = 0; x < benchmarks.length ; x++) { - benchmarks[x].Setup(); - } - print_verbose("Running '" + arg.file + "' for " + iters + " iterations of no less than " + min_time + " seconds (" + runtime + ")"); - - var scores = []; - - var min_time_ms = min_time * 1000; - var len = benchmarks.length; - - for (var it = 0; it < iters + 1; it++) { - //every iteration must take a minimum of 10 secs - var ops = 0; - var elapsed = 0; - var start = new Date; - do { - for (var i = 0; i < len; i++) { - benchmarks[i].run(); - } - ops += len; - elapsed = new Date - start; - } while (elapsed < min_time * 1000); - - var score = ops / elapsed * 1000 * 60; - scores.push(score); - var name = it == 0 ? "warmup" : "iteration " + it; - print_verbose("[" + arg.file + "] " + name + " finished " + score.toFixed(0) + " ops/minute"); - } - for (var x = 0; x < benchmarks.length ; x++) { - benchmarks[x].TearDown(); - } - var min_score = 1e9; var max_score = 0; var mean_score = 0; - for (var x = 1; x < iters + 1 ; x++) { - mean_score += scores[x]; - min_score = Math.min(min_score, scores[x]); - max_score = Math.max(max_score, scores[x]); + + try { + for (var x = 0; x < benchmarks.length ; x++) { + benchmarks[x].Setup(); + } + print_verbose("Running '" + arg.file + "' for " + iters + " iterations of no less than " + min_time + " seconds (" + runtime + ")"); + + var scores = []; + + var min_time_ms = min_time * 1000; + var len = benchmarks.length; + + for (var it = 0; it < iters + 1; it++) { + //every iteration must take a minimum of 10 secs + var ops = 0; + var elapsed = 0; + var start = new Date; + do { + for (var i = 0; i < len; i++) { + benchmarks[i].run(); + } + ops += len; + elapsed = new Date - start; + } while (elapsed < min_time * 1000); + + var score = ops / elapsed * 1000 * 60; + scores.push(score); + var name = it == 0 ? "warmup" : "iteration " + it; + print_verbose("[" + arg.file + "] " + name + " finished " + score.toFixed(0) + " ops/minute"); + } + + for (var x = 0; x < benchmarks.length ; x++) { + benchmarks[x].TearDown(); + } + + for (var x = 1; x < iters + 1 ; x++) { + mean_score += scores[x]; + min_score = Math.min(min_score, scores[x]); + max_score = Math.max(max_score, scores[x]); + } + mean_score /= iters; + + } catch (e) { + print_always("*** Aborted and setting score to zero. Reason: " + e); + mean_score = min_score = max_score = 0; + scores = [0]; } - mean_score /= iters; + var res = "[" + arg.file + "] " + mean_score.toFixed(0); if (verbose) { res += " ops/minute (" + min_score.toFixed(0) + "-" + max_score.toFixed(0) + "), warmup=" + scores[0].toFixed(0); @@ -156,6 +166,7 @@ runtime = "command line"; var args = []; + if (typeof $ARGS !== 'undefined') { args = $ARGS; } else if (typeof arguments !== 'undefined' && arguments.length != 0) {