nashorn/make/build-benchmark.xml
author katleman
Thu, 16 May 2013 12:14:19 -0700
changeset 17355 4f531492e774
parent 16169 45718b3a87eb
child 17774 0407501fa563
permissions -rw-r--r--
Added tag jdk8-b90 for changeset c0cc3acd917d

<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
 This code is free software; you can redistribute it and/or modify it
 under the terms of the GNU General Public License version 2 only, as
 published by the Free Software Foundation.
 
 This code is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 version 2 for more details (a copy is included in the LICENSE file that
 accompanied this code).
 
 You should have received a copy of the GNU General Public License version
 2 along with this work; if not, write to the Free Software Foundation,
 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 or visit www.oracle.com if you need additional information or have any
 questions.
-->
<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"/>
  </target>

  <!-- box2d -->
  <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-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-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="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-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-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="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-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-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="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-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-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="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-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-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="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>

  <!-- 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>

  <!-- 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"/>

  <target name="--single-process" unless="${octane-test-sys-prop.separate.process}">
    <antcall target="octane-single-process"/>
  </target>
  <target name="--separate-process" if="${octane-test-sys-prop.separate.process}">
    <antcall target="octane-separate-process"/>
  </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">
    <antcall target="run-octane-v8"/>
  </target>

  <!-- run octane benchmarks using Rhino as runtime -->
  <target name="octane-rhino" depends="octane-init">
    <antcall target="run-octane-rhino"/>
  </target>
  
  <target name="run-octane">
    <java classname="${nashorn.shell.tool}"
          classpath="${run.test.classpath}"
          fork="true"
          dir=".">
      <jvmarg line="${ext.class.path}"/>
      <jvmarg line="${run.test.jvmargs.octane}"/>
      <arg value="${octane-test-sys-prop.test.js.framework}"/>
      <arg value="--"/>
      <arg value="${octane-tests}"/>
      <arg value="--runtime"/>
      <arg value="Nashorn"/>
      <arg value="--verbose"/>
      <arg value="--iterations 8"/>
    </java>
  </target>

  <target name="run-octane-v8">
    <exec executable="${v8.shell}">
      <arg value="${octane-test-sys-prop.test.js.framework}"/>
      <arg value="--"/>
      <arg value="${octane-tests}"/>      
      <arg value="--runtime"/>
      <arg value="v8"/>
      <arg value="--verbose"/>
      <arg value="--iterations 8"/>
    </exec>
  </target>

  <target name="run-octane-rhino">
    <java jar="${rhino.jar}"
          classpath="${run.test.classpath}"
          fork="true"
          dir=".">
      <jvmarg line="${run.test.jvmargs.octane}"/>
      <arg value="${octane-test-sys-prop.test.js.framework}"/>
      <arg value="${octane-tests}"/>
      <arg value="--runtime"/>
      <arg value="Rhino"/>
      <arg value="--verbose"/>
      <arg value="--iterations 8"/>
    </java>
  </target>

  <!-- run octane with all known runtimes for comparison -->
  <target name="octane-all" depends="octane, octane-v8, octane-rhino">
    <exec executable="${v8.shell}">
      <arg value="${octane-test-sys-prop.test.js.framework}"/>
      <arg value="${octane-tests}/"/>
    </exec>
  </target>
   
  <target name="sunspider-init" depends="jar">
    <fileset id="sunspider-set"
	     dir="${sunspider-test-sys-prop.test.js.roots}"
	     excludes="${sunspider-test-sys-prop.test.js.exclude.list}">
      <include name="**/*.js"/>
    </fileset>
    <pathconvert pathsep=" " property="sunspider-tests" refid="sunspider-set"/>
  </target>

  <!-- run sunspider with Nashorn -->
  <target name="sunspider" depends="sunspider-init">
    <java classname="${nashorn.shell.tool}"
          classpath="${run.test.classpath}"
          fork="true"
          dir=".">
      <jvmarg line="${ext.class.path}"/>
      <jvmarg line="${run.test.jvmargs}"/>
      <arg value="-timezone=PST"/>
      <arg value="--class-cache-size=50"/>
      <arg value="${sunspider-test-sys-prop.test.js.framework}"/>
      <arg value="--"/>
      <arg value="${sunspider-tests}/"/>
    </java>
  </target>

  <!-- run sunspider with v8 -->
  <target name="sunspider-v8" depends="sunspider-init">
    <exec executable="${v8.shell}">
      <arg value="${sunspider-test-sys-prop.test.js.framework}"/>
      <arg value="--"/>
      <arg value="${sunspider-tests}/"/>
    </exec>
  </target>

  <!-- run sunspider with Rhino -->
  <target name="sunspider-rhino" depends="sunspider-init">
    <java jar="${rhino.jar}"
          classpath="${run.test.classpath}"
          fork="true"
          dir=".">
      <jvmarg line="${run.test.jvmargs}"/>
      <arg value="${sunspider-test-sys-prop.test.js.framework}"/>
      <arg value="${sunspider-tests}/"/>
    </java>
  </target>

</project>