8006082: Provide option to run octane benchmarks in separate processes
authorsundar
Fri, 11 Jan 2013 18:26:18 +0530
changeset 16169 45718b3a87eb
parent 16168 f0c208287983
child 16170 9e3f4e0b519b
8006082: Provide option to run octane benchmarks in separate processes Reviewed-by: lagergren, jlaskey
nashorn/make/build-benchmark.xml
nashorn/make/project.properties
--- a/nashorn/make/build-benchmark.xml	Fri Jan 11 10:40:51 2013 +0100
+++ b/nashorn/make/build-benchmark.xml	Fri Jan 11 18:26:18 2013 +0530
@@ -30,205 +30,276 @@
       <include name="*.js"/>
     </fileset>
     <pathconvert pathsep=" " property="octane-tests" refid="octane-set"/>
-    <property name="extra-arg" value=""/>
   </target>
 
   <!-- box2d -->
-  <target name="box2d-init">
-    <property name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/box2d.js"/>
+  <target name="octane-box2d" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/box2d.js"/>
+    </antcall>
   </target>
 
-  <target name="octane-box2d" depends="jar, box2d-init, octane-verbose">
-    <antcall target="run-octane"/>
+  <target name="octane-box2d-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/box2d.js"/>
+    </antcall>
   </target>
 
-  <target name="octane-box2d-v8" depends="jar, box2d-init, octane-verbose">
-    <antcall target="run-octane-v8"/>
-  </target>
-
-  <target name="octane-box2d-rhino" depends="jar, box2d-init, octane-verbose">
-    <antcall target="run-octane-rhino"/>
+  <target name="octane-box2d-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/box2d.js"/>
+    </antcall>
   </target>
 
   <!-- code-load -->  
-  <target name="code-load-init">
-    <property name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/code-load.js"/>
+  <target name="octane-code-load" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/code-load.js"/>
+    </antcall>
   </target>
 
-  <target name="octane-code-load" depends="jar, code-load-init, octane-verbose">
-    <antcall target="run-octane"/>
+  <target name="octane-code-load-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/code-load.js"/>
+    </antcall>
   </target>
 
-  <target name="octane-code-load-v8" depends="jar, code-load-init, octane-verbose">
-    <antcall target="run-octane-v8"/>
-  </target>
-
-  <target name="octane-code-load-rhino" depends="jar, code-load-init, octane-verbose">
-    <antcall target="run-octane-rhino"/>
+  <target name="octane-code-load-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/code-load.js"/>
+    </antcall>
   </target>
 
   <!-- crypto -->
-  <target name="crypto-init">
-    <property name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/crypto.js"/>
+  <target name="octane-crypto" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/crypto.js"/>
+    </antcall>
   </target>
 
-  <target name="octane-crypto" depends="jar, crypto-init, octane-verbose">
-    <antcall target="run-octane"/>
+  <target name="octane-crypto-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/crypto.js"/>
+    </antcall>
   </target>
 
-  <target name="octane-crypto-v8" depends="jar, crypto-init, octane-verbose">
-    <antcall target="run-octane-v8"/>
-  </target>
-
-  <target name="octane-crypto-rhino" depends="jar, crypto-init, octane-verbose">
-    <antcall target="run-octane-rhino"/>
+  <target name="octane-crypto-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/crypto.js"/>
+    </antcall>
   </target>
 
   <!-- deltablue -->
-  <target name="deltablue-init">
-    <property name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/deltablue.js"/>
+  <target name="octane-deltablue" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/deltablue.js"/>
+    </antcall>
   </target>
 
-  <target name="octane-deltablue" depends="jar, deltablue-init, octane-verbose">
-    <antcall target="run-octane"/>
+  <target name="octane-deltablue-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/deltablue.js"/>
+    </antcall>
   </target>
 
-  <target name="octane-deltablue-v8" depends="jar, deltablue-init, octane-verbose">
-    <antcall target="run-octane-v8"/>
-  </target>
-
-  <target name="octane-deltablue-rhino" depends="jar, deltablue-init, octane-verbose">
-    <antcall target="run-octane-rhino"/>
+  <target name="octane-deltablue-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/deltablue.js"/>
+    </antcall>
   </target>
 
   <!-- earley-boyer -->
-  <target name="earley-boyer-init">
-    <property name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/earley-boyer.js"/>
+  <target name="octane-earley-boyer" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/earley-boyer.js"/>
+    </antcall>
   </target>
 
-  <target name="octane-earley-boyer" depends="jar, earley-boyer-init, octane-verbose">
-    <antcall target="run-octane"/>
+  <target name="octane-earley-boyer-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/earley-boyer.js"/>
+    </antcall>
   </target>
 
-  <target name="octane-earley-boyer-v8" depends="jar, earley-boyer-init, octane-verbose">
-    <antcall target="run-octane-v8"/>
-  </target>
-
-  <target name="octane-earley-boyer-rhino" depends="jar, earley-boyer-init, octane-verbose">
-    <antcall target="run-octane-rhino"/>
+  <target name="octane-earley-boyer-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/earley-boyer.js"/>
+    </antcall>
   </target>
 
   <!-- gbemu -->  
-  <target name="gbemu-init">
-    <property name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/gbemu.js"/>
+  <target name="octane-gbemu" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/gbemu.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-gbemu-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/gbemu.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-gbemu-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/gbemu.js"/>
+    </antcall>
+  </target>
+
+  <!-- mandreel -->  
+  <target name="octane-mandreel" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/mandreel.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-mandreel-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/mandreel.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-mandreel-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/mandreel.js"/>
+    </antcall>
+  </target>
+
+  <!-- navier-stokes -->
+  <target name="octane-navier-stokes" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/navier-stokes.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-navier-stokes-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/navier-stokes.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-navier-stokes-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/navier-stokes.js"/>
+    </antcall>
+  </target>
+
+  <!-- pdfjs -->  
+  <target name="octane-pdfjs" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/pdfjs.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-pdfjs-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/pdfjs.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-pdfjs-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/pdfjs.js"/>
+    </antcall>
   </target>
 
-  <target name="octane-gbemu" depends="jar, gbemu-init, octane-verbose">
+  <!-- raytrace -->
+  <target name="octane-raytrace" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/raytrace.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-raytrace-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/raytrace.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-raytrace-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/raytrace.js"/>
+    </antcall>
+  </target>
+
+  <!-- regexp -->
+  <target name="octane-regexp" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/regexp.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-regexp-octane-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/regexp.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-regexp-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/regexp.js"/>
+    </antcall>
+  </target>
+
+  <!-- richards -->
+  <target name="octane-richards" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/richards.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-richards-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/richards.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-richards-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/richards.js"/>
+    </antcall>
+  </target>
+
+  <!-- splay -->
+  <target name="octane-splay" depends="jar">
+    <antcall target="run-octane">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/splay.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-splay-v8" depends="jar">
+    <antcall target="run-octane-v8">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/splay.js"/>
+    </antcall>
+  </target>
+
+  <target name="octane-splay-rhino" depends="jar">
+    <antcall target="run-octane-rhino">
+      <param name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/splay.js"/>
+    </antcall>
+  </target>
+
+  <!-- run octane benchmarks in a single process  -->
+  <target name="octane-single-process" depends="octane-init">
     <antcall target="run-octane"/>
   </target>
 
-  <target name="octane-gbemu-v8" depends="jar, gbemu-init, octane-verbose">
-    <antcall target="run-octane-v8"/>
-  </target>
-
-  <target name="octane-gbemu-rhino" depends="jar, gbemu-init, octane-verbose">
-    <antcall target="run-octane-rhino"/>
-  </target>
-
-  <!-- navier-stokes -->
-  <target name="navier-stokes-init">
-    <property name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/navier-stokes.js"/>
-  </target>
-
-  <target name="octane-navier-stokes" depends="jar, navier-stokes-init, octane-verbose">
-    <antcall target="run-octane"/>
-  </target>
-
-  <target name="octane-navier-stokes-v8" depends="jar, navier-stokes-init, octane-verbose">
-    <antcall target="run-octane-v8"/>
-  </target>
-
-  <target name="octane-navier-stokes-rhino" depends="jar, navier-stokes-init, octane-verbose">
-    <antcall target="run-octane-rhino"/>
-  </target>
+  <!-- mandreel excluded due to OOM -->
+  <target name="octane-separate-process" depends=
+     "octane-box2d, octane-code-load, octane-crypto, 
+      octane-deltablue, octane-earley-boyer, octane-gbemu,
+      octane-navier-stokes, octane-pdfjs, octane-raytrace, 
+      octane-regexp, octane-richards, octane-splay"/>
 
-  <!-- pdfjs -->  
-  <target name="pdfjs-init">
-    <property name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/pdfjs.js"/>
-  </target>
-
-  <target name="octane-pdfjs" depends="jar, pdfjs-init, octane-verbose">
-    <antcall target="run-octane"/>
-  </target>
-
-  <target name="octane-pdfjs-v8" depends="jar, pdfjs-init, octane-verbose">
-    <antcall target="run-octane-v8"/>
+  <target name="--single-process" unless="${octane-test-sys-prop.separate.process}">
+    <antcall target="octane-single-process"/>
   </target>
-
-  <target name="octane-pdfjs-rhino" depends="jar, pdfjs-init, octane-verbose">
-    <antcall target="run-octane-rhino"/>
-  </target>
-
-  <!-- raytrace -->
-  <target name="raytrace-init">
-    <property name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/raytrace.js"/>
-  </target>
-
-  <target name="octane-raytrace" depends="jar, raytrace-init, octane-verbose">
-    <antcall target="run-octane"/>
+  <target name="--separate-process" if="${octane-test-sys-prop.separate.process}">
+    <antcall target="octane-separate-process"/>
   </target>
 
-  <target name="octane-raytrace-v8" depends="jar, raytrace-init, octane-verbose">
-    <antcall target="run-octane-v8"/>
-  </target>
-
-  <target name="octane-raytrace-rhino" depends="jar, raytrace-init, octane-verbose">
-    <antcall target="run-octane-rhino"/>
-  </target>
-
-  <!-- regexp -->
-  <target name="regexp-init">
-    <property name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/regexp.js"/>
-  </target>
-
-  <target name="octane-regexp" depends="jar, regexp-init, octane-verbose">
-    <antcall target="run-octane"/>
-  </target>
-
-  <target name="octane-regexp-octane-v8" depends="jar, regexp-init, octane-verbose">
-    <antcall target="run-octane-v8"/>
-  </target>
-
-  <target name="octane-regexp-rhino" depends="jar, regexp-init, octane-verbose">
-    <antcall target="run-octane-rhino"/>
-  </target>
-
-
-  <!-- splay -->
-  <target name="splay-init">
-    <property name="octane-tests" value="${octane-test-sys-prop.test.js.roots}/splay.js"/>
-  </target>
-
-  <target name="octane-splay" depends="jar, splay-init, octane-verbose">
-    <antcall target="run-octane"/>
-  </target>
-
-  <target name="octane-splay-v8" depends="jar, splay-init, octane-verbose">
-    <antcall target="run-octane-v8"/>
-  </target>
-
-  <target name="octane-splay-rhino" depends="jar, splay-init, octane-verbose">
-    <antcall target="run-octane-rhino"/>
-  </target>
-
-  <target name="octane-verbose">
-    <property name="extra-arg" value="--verbose"/>
-  </target>
-
-  <!-- run octane benchmarks using Nashorn as runtime -->
-  <target name="octane" depends="octane-init">
-    <antcall target="run-octane"/>
-  </target>
+  <!-- run 'octane' in single or separate processes based on config -->
+  <target name="octane" depends="init, --single-process, --separate-process"/>
 
   <!-- run octane benchmarks using octane as runtime -->
   <target name="octane-v8" depends="octane-init">
@@ -254,7 +325,6 @@
       <arg value="Nashorn"/>
       <arg value="--verbose"/>
       <arg value="--iterations 8"/>
-      <arg value="${extra-arg}"/>
     </java>
   </target>
 
@@ -267,7 +337,6 @@
       <arg value="v8"/>
       <arg value="--verbose"/>
       <arg value="--iterations 8"/>
-      <arg value="${extra-arg}"/>
     </exec>
   </target>
 
@@ -283,7 +352,6 @@
       <arg value="Rhino"/>
       <arg value="--verbose"/>
       <arg value="--iterations 8"/>
-      <arg value="${extra-arg}"/>
     </java>
   </target>
 
--- a/nashorn/make/project.properties	Fri Jan 11 10:40:51 2013 +0100
+++ b/nashorn/make/project.properties	Fri Jan 11 18:26:18 2013 +0530
@@ -156,13 +156,18 @@
 # test root for octane
 octane-test-sys-prop.test.js.roots=${test.external.dir}/octane/
 
+# run octane benchmars in separate processes?
+octane-test-sys-prop.separate.process=true
+
 # framework root for octane
 octane-test-sys-prop.test.js.framework=${test.basic.dir}/run-octane.js
 
 # list of tests to be excluded
+# mandreel excluded due to OOM
 octane-test-sys-prop.test.js.exclude.list=\
     base.js \
-    run.js
+    run.js  \
+    mandreel.js
 
 # test root for sunspider
 sunspider-test-sys-prop.test.js.roots=${test.external.dir}/sunspider/tests/sunspider-1.0/