Move benchmarks into core

This commit is contained in:
str4d
2017-09-08 11:16:40 +00:00
parent 7346ce1c89
commit 3d24cc9e92
7 changed files with 66 additions and 112 deletions

View File

@ -1,105 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="all" name="benchmarks">
<target name="all" depends="clean, build" />
<target name="build" depends="builddep, jar" />
<target name="builddep">
<!-- run from top level build.xml to get dependencies built -->
</target>
<condition property="depend.available">
<typefound name="depend" />
</condition>
<target name="depend" if="depend.available">
<depend
cache="../../build"
srcdir="./src"
destdir="./build/obj" >
<!-- Depend on classes instead of jars where available -->
<classpath>
<pathelement location="../../core/java/build/obj" />
</classpath>
</depend>
</target>
<!-- only used if not set by a higher build.xml -->
<property name="javac.compilerargs" value="" />
<property name="javac.version" value="1.7" />
<target name="jmhLibCheck">
<!-- override to Ant home if not set -->
<property name="jmh.home" value="${ant.home}/lib" />
<fail message="Please set jmh.home to a directory containing the necessary JMH libraries. See build.properties for details.">
<condition>
<not>
<and>
<available file="${jmh.home}/jmh-core.jar" />
<available file="${jmh.home}/jmh-generator-annprocess.jar" />
<available file="${jmh.home}/jopt-simple.jar" />
<available file="${jmh.home}/commons-math3.jar" />
</and>
</not>
</condition>
</fail>
</target>
<target name="compile" depends="depend, jmhLibCheck">
<mkdir dir="./build" />
<mkdir dir="./build/obj" />
<javac srcdir="./src" debug="true" source="${javac.version}" target="${javac.version}" deprecation="on"
debuglevel="lines,vars,source"
includeAntRuntime="false"
destdir="./build/obj" >
<classpath>
<pathelement location="${jmh.home}/jmh-core.jar" />
<pathelement location="${jmh.home}/jmh-generator-annprocess.jar" />
<pathelement location="../../core/java/build/i2p.jar" />
</classpath>
<compilerarg line="${javac.compilerargs}" />
</javac>
</target>
<target name="listChangedFiles" if="mtn.available" >
<exec executable="mtn" outputproperty="workspace.changes" errorproperty="mtn.error2" failifexecutionfails="false" >
<arg value="list" />
<arg value="changed" />
<arg value="." />
</exec>
<!-- \n in an attribute value generates an invalid manifest -->
<exec executable="tr" inputstring="${workspace.changes}" outputproperty="workspace.changes.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
<arg value="-s" />
<arg value="[:space:]" />
<arg value="," />
</exec>
</target>
<target name="jar" depends="compile, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
<!-- set if unset -->
<property name="workspace.changes.tr" value="" />
<jar destfile="./build/benchmarks.jar" basedir="./build/obj" >
<manifest>
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
<attribute name="Main-Class" value="org.openjdk.jmh.Main" />
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
<attribute name="X-Compile-Source-JDK" value="${javac.version}" />
<attribute name="X-Compile-Target-JDK" value="${javac.version}" />
</manifest>
<zipfileset src="${jmh.home}/jmh-core.jar" excludes="**/META-INF/services/**" />
<zipfileset src="${jmh.home}/jopt-simple.jar" />
<zipfileset src="${jmh.home}/commons-math3.jar" />
<zipfileset src="../../core/java/build/i2p.jar" />
</jar>
</target>
<target name="jarUpToDate">
<uptodate property="jar.uptodate" targetfile="build/benchmarks.jar" >
<srcfiles dir= "." includes="build/obj/**/*.class" />
</uptodate>
</target>
<target name="clean">
<delete dir="./build" />
</target>
<target name="distclean" depends="clean" />
</project>

View File

@ -994,7 +994,6 @@
<delete dir="core/c/jcpuid/lib" />
<ant dir="installer/resources/locale" target="distclean" />
<ant dir="installer/tools/java" target="distclean" />
<ant dir="benchmarks/java" target="distclean" />
<!--
NOTE! We need to turn off the default excludes for these
patterns to work.
@ -1846,8 +1845,8 @@
<target name="testscripts-all" depends="testscripts,testscripts-net" />
<target name="bench" depends="buildCore, jbigi" >
<ant dir="benchmarks/java/" target="all" />
<target name="bench" depends="jbigi" >
<ant dir="core/java/" target="bench.jar" />
</target>
<!-- <target name="syndie" >

View File

@ -382,6 +382,66 @@
<target name="fulltest" depends="test, test.report" />
<!-- end unit tests -->
<!-- benchmarks -->
<target name="jmhLibCheck">
<!-- override to Ant home if not set -->
<property name="jmh.home" value="${ant.home}/lib" />
<fail message="Please set jmh.home to a directory containing the necessary JMH libraries. See build.properties for details.">
<condition>
<not>
<and>
<available file="${jmh.home}/jmh-core.jar" />
<available file="${jmh.home}/jmh-generator-annprocess.jar" />
<available file="${jmh.home}/jopt-simple.jar" />
<available file="${jmh.home}/commons-math3.jar" />
</and>
</not>
</condition>
</fail>
</target>
<target name="bench.compile" depends="compile, jmhLibCheck">
<mkdir dir="./build" />
<mkdir dir="./build/obj_bench" />
<javac srcdir="./bench" debug="true" source="${javac.version}" target="${javac.version}" deprecation="on"
debuglevel="lines,vars,source"
includeAntRuntime="false"
destdir="./build/obj_bench" >
<classpath>
<pathelement location="${jmh.home}/jmh-core.jar" />
<pathelement location="${jmh.home}/jmh-generator-annprocess.jar" />
<pathelement location="./build/obj" />
</classpath>
<compilerarg line="${javac.compilerargs}" />
</javac>
</target>
<target name="bench.jar" depends="bench.compile, bench.jarUpToDate, listChangedFiles" unless="bench.jar.uptodate" >
<!-- set if unset -->
<property name="workspace.changes.tr" value="" />
<jar destfile="./build/i2p-benchmarks.jar" basedir="./build/obj_bench" >
<manifest>
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
<attribute name="Main-Class" value="org.openjdk.jmh.Main" />
<attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
<attribute name="X-Compile-Source-JDK" value="${javac.version}" />
<attribute name="X-Compile-Target-JDK" value="${javac.version}" />
</manifest>
<zipfileset src="${jmh.home}/jmh-core.jar" excludes="**/META-INF/services/**" />
<zipfileset src="${jmh.home}/jopt-simple.jar" />
<zipfileset src="${jmh.home}/commons-math3.jar" />
<fileset dir="./build/obj" includes="**/*.class" />
</jar>
</target>
<target name="bench.jarUpToDate">
<uptodate property="bench.jar.uptodate" targetfile="build/i2p-benchmarks.jar" >
<srcfiles dir= "." includes="build/obj_bench/**/*.class" />
</uptodate>
</target>
<target name="clean">
<delete dir="./build" />
</target>

View File

@ -8,11 +8,11 @@ fi
if [ "x$BENCHMARKS" = 'x' ]
then
BENCHMARKS="$CWD/benchmarks.jar"
BENCHMARKS="$CWD/i2p-benchmarks.jar"
stat "$BENCHMARKS" >/dev/null 2>&1
if [ "x$?" != 'x0' ]
then
BENCHMARKS="$CWD/java/build/benchmarks.jar"
BENCHMARKS="$CWD/../../core/java/build/i2p-benchmarks.jar"
fi
fi
@ -22,7 +22,7 @@ then
stat "$JBIGI" >/dev/null 2>&1
if [ "x$?" != 'x0' ]
then
JBIGI="$CWD/../build/jbigi.jar"
JBIGI="$CWD/../../build/jbigi.jar"
fi
fi
@ -33,4 +33,4 @@ then
shift
fi
$JAVA -cp "$CLASSPATH" "$@"
$JAVA -cp "$CLASSPATH" org.openjdk.jmh.Main "$@"