8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino

Mon, 27 May 2013 17:57:07 +0200

author
lagergren
date
Mon, 27 May 2013 17:57:07 +0200
changeset 298
e6193dcfe36c
parent 297
343fd0450802
child 299
d56168970de1

8015447: Octane harness fixes for rhino and entire test runs: ant octane, ant octane-v8, ant octane-rhino
Reviewed-by: sundar, jlaskey

make/build-benchmark.xml file | annotate | diff | comparison | revisions
test/script/basic/run-octane.js file | annotate | diff | comparison | revisions
     1.1 --- a/make/build-benchmark.xml	Mon May 27 20:41:34 2013 +0530
     1.2 +++ b/make/build-benchmark.xml	Mon May 27 17:57:07 2013 +0200
     1.3 @@ -24,14 +24,13 @@
     1.4  <project name="nashorn-benchmarks" default="all" basedir="..">
     1.5  
     1.6    <target name="octane-init" depends="jar">
     1.7 -    <fileset id="octane-set"
     1.8 -	     dir="${octane-test-sys-prop.test.js.roots}"
     1.9 -	     excludes="${octane-test-sys-prop.test.js.exclude.list}">
    1.10 -      <include name="*.js"/>
    1.11 -    </fileset>
    1.12 -    <pathconvert pathsep=" " property="octane-tests" refid="octane-set"/>
    1.13 +    <property name="octane-tests" value="box2d code-load crypto deltablue earley-boyer gbemu navier-stokes pdfjs raytrace regexp richards splay"/>
    1.14    </target>
    1.15 -
    1.16 +  
    1.17 +  <!-- ignore benchmarks where rhino crashes -->
    1.18 +  <target name="octane-init-rhino" depends="jar">
    1.19 +    <property name="octane-tests" value="box2d code-load crypto deltablue earley-boyer gbemu navier-stokes raytrace regexp richards splay"/>
    1.20 +  </target>
    1.21  
    1.22    <!-- box2d -->
    1.23    <target name="octane-box2d" depends="jar">
    1.24 @@ -320,7 +319,7 @@
    1.25    </target>
    1.26  
    1.27    <!-- run octane benchmarks using Rhino as runtime -->
    1.28 -  <target name="octane-rhino" depends="octane-init">
    1.29 +  <target name="octane-rhino" depends="octane-init-rhino">
    1.30      <antcall target="run-octane-rhino"/>
    1.31    </target>
    1.32    
     2.1 --- a/test/script/basic/run-octane.js	Mon May 27 20:41:34 2013 +0530
     2.2 +++ b/test/script/basic/run-octane.js	Mon May 27 17:57:07 2013 +0200
     2.3 @@ -89,47 +89,57 @@
     2.4      }
     2.5      
     2.6      var benchmarks = eval(arg.suite + ".benchmarks");
     2.7 -    for (var x = 0; x < benchmarks.length ; x++) { 
     2.8 -	benchmarks[x].Setup();
     2.9 -    }
    2.10 -    print_verbose("Running '" + arg.file + "' for " + iters + " iterations of no less than " + min_time + " seconds (" + runtime + ")");
    2.11 -    
    2.12 -    var scores = [];
    2.13 -    
    2.14 -    var min_time_ms = min_time * 1000;
    2.15 -    var len = benchmarks.length;
    2.16 -    
    2.17 -    for (var it = 0; it < iters + 1; it++) {
    2.18 -	//every iteration must take a minimum of 10 secs
    2.19 -	var ops = 0;
    2.20 -	var elapsed = 0;
    2.21 -	var start = new Date;
    2.22 -	do {
    2.23 -	    for (var i = 0; i < len; i++) {
    2.24 -		benchmarks[i].run();
    2.25 -	    }	    
    2.26 -	    ops += len;
    2.27 -	    elapsed = new Date - start;
    2.28 -	} while (elapsed < min_time * 1000);
    2.29 -	
    2.30 -	var score = ops / elapsed * 1000 * 60;
    2.31 -	scores.push(score);
    2.32 -	var name = it == 0 ? "warmup" : "iteration " + it;   
    2.33 -	print_verbose("[" + arg.file + "] " + name + " finished " + score.toFixed(0) + " ops/minute");
    2.34 -    }
    2.35 -    for (var x = 0; x < benchmarks.length ; x++) { 
    2.36 -	benchmarks[x].TearDown();
    2.37 -    }
    2.38 -
    2.39      var min_score  = 1e9;
    2.40      var max_score  = 0;
    2.41      var mean_score = 0;
    2.42 -    for (var x = 1; x < iters + 1 ; x++) {
    2.43 -	mean_score += scores[x];
    2.44 -	min_score = Math.min(min_score, scores[x]);
    2.45 -	max_score = Math.max(max_score, scores[x]);
    2.46 +
    2.47 +    try {
    2.48 +	for (var x = 0; x < benchmarks.length ; x++) { 
    2.49 +	    benchmarks[x].Setup();
    2.50 +	}
    2.51 +	print_verbose("Running '" + arg.file + "' for " + iters + " iterations of no less than " + min_time + " seconds (" + runtime + ")");
    2.52 +	
    2.53 +	var scores = [];
    2.54 +	
    2.55 +	var min_time_ms = min_time * 1000;
    2.56 +	var len = benchmarks.length;    
    2.57 +	
    2.58 +	for (var it = 0; it < iters + 1; it++) {
    2.59 +	    //every iteration must take a minimum of 10 secs
    2.60 +	    var ops = 0;
    2.61 +	    var elapsed = 0;
    2.62 +	    var start = new Date;
    2.63 +	    do {
    2.64 +		for (var i = 0; i < len; i++) {
    2.65 +		    benchmarks[i].run();
    2.66 +		}	    
    2.67 +		ops += len;
    2.68 +		elapsed = new Date - start;
    2.69 +	    } while (elapsed < min_time * 1000);
    2.70 +	    
    2.71 +	    var score = ops / elapsed * 1000 * 60;
    2.72 +	    scores.push(score);
    2.73 +	    var name = it == 0 ? "warmup" : "iteration " + it;   
    2.74 +	    print_verbose("[" + arg.file + "] " + name + " finished " + score.toFixed(0) + " ops/minute");
    2.75 +	}
    2.76 +
    2.77 +	for (var x = 0; x < benchmarks.length ; x++) { 
    2.78 +	    benchmarks[x].TearDown();
    2.79 +	}
    2.80 +
    2.81 +	for (var x = 1; x < iters + 1 ; x++) {
    2.82 +	    mean_score += scores[x];
    2.83 +	    min_score = Math.min(min_score, scores[x]);
    2.84 +	    max_score = Math.max(max_score, scores[x]);
    2.85 +	}
    2.86 +	mean_score /= iters;    
    2.87 +
    2.88 +    } catch (e) {
    2.89 +	print_always("*** Aborted and setting score to zero. Reason: " + e);
    2.90 +	mean_score = min_score = max_score = 0;
    2.91 +	scores = [0];
    2.92      }
    2.93 -    mean_score /= iters;    
    2.94 +
    2.95      var res = "[" + arg.file + "] " + mean_score.toFixed(0);
    2.96      if (verbose) {
    2.97  	res += " ops/minute (" + min_score.toFixed(0) + "-" + max_score.toFixed(0) + "), warmup=" + scores[0].toFixed(0);
    2.98 @@ -156,6 +166,7 @@
    2.99  runtime = "command line";
   2.100  
   2.101  var args = [];
   2.102 +
   2.103  if (typeof $ARGS !== 'undefined') {
   2.104      args = $ARGS;
   2.105  } else if (typeof arguments !== 'undefined' && arguments.length != 0) {

mercurial