-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
119 lines (114 loc) · 5.25 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="psy-lob-saw" default="build">
<property name="ivy.install.version" value="2.0.0-beta1" />
<property name="ivy.jar.dir" value="${basedir}/ivy" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<property name="allocation.jar.file" value="${basedir}/lib/allocation.jar" />
<condition property="skip.download.ivy">
<and>
<available file="${ivy.jar.file}"/>
</and>
</condition>
<condition property="skip.download.allocation">
<and>
<available file="${allocation.jar.file}"/>
</and>
</condition>
<property name="build.dir" value="build" />
<property name="src.dir" value="src" />
<property name="experiments.dir" value="experiments" />
<target name="download-ivy" unless="skip.download.ivy">
<mkdir dir="${ivy.jar.dir}" />
<!--
download Ivy from web site so that it can be used even without any special installation
-->
<echo message="downloading ivy..." />
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true" />
</target>
<target name="download-allocation-jar" unless="skip.download.allocation">
<mkdir dir="lib" />
<!--
download allocation jar, I'm sure there's a better way to do this with Ivy, but fuck it
-->
<echo message="downloading allocation jar.." />
<get src="http://java-allocation-instrumenter.googlecode.com/files/allocation.jar" dest="${allocation.jar.file}" usetimestamp="true" />
</target>
<!--
this target is not necessary if you put ivy.jar in your ant lib directory if you already have ivy in your ant lib, you can simply remove this target and the dependency the 'go' target has on it =================================
-->
<target name="install-ivy" depends="download-ivy" description="--> install ivy">
<!--
try to load ivy here from local ivy dir, in case the user has not already dropped it into ant's lib dir (note that the latter copy will always take precedence). We will not fail as long as local lib dir exists (it may be empty) and ivy is in at least one of ant's lib dir or the local lib dir.
-->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar" />
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" />
</target>
<target name="build" depends="install-ivy" description=" resolve dependencies, compile and run the project">
<ivy:cachepath pathid="lib.path.id" />
<echo message="compiling..." />
<mkdir dir="${build.dir}" />
<javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="lib.path.id" />
<javac srcdir="${experiments.dir}" destdir="${build.dir}" classpathref="lib.path.id" />
</target>
<target name="benchmark-utf8-encoding" depends="build,download-allocation-jar" description=" run experiments">
<ivy:cachepath pathid="lib.path.id" />
<java classpathref="lib.path.id" classname="utf8.Utf8EncodingBenchmark" fork="true">
<classpath>
<pathelement path="${build.dir}"/>
<pathelement location="${allocation.jar.file}"/>
</classpath>
<env key="ALLOCATION_JAR" value="${allocation.jar.file}"/>
<arg value="--measureMemory" />
</java>
</target>
<target name="run-unaligned-experiments" depends="build" description=" run experiments">
<ivy:cachepath pathid="lib.path.id" />
<echo message="running experiments..." />
<java classpathref="lib.path.id" classname="com.google.caliper.Runner" fork="true">
<classpath path="${build.dir}" />
<arg value="--warmupMillis" />
<arg value="1000" />
<arg value="--runMillis" />
<arg value="5000" />
<arg value="alignment.UnalignedMemoryAccessCostBenchmark" />
<arg value="-Doffset=0,1,2,3,4,5,6,7,8,16,24,32,40,48,56,60" />
<arg value="-DsizeInPages=1,2,4,8,16,32,64,128,256,512,1024,2048" />
</java>
</target>
<target name="run-unaligned-fibonacci" depends="build" description=" run experiments">
<ivy:cachepath pathid="lib.path.id" />
<echo message="running experiments..." />
<java classpathref="lib.path.id" classname="com.google.caliper.Runner" fork="true">
<classpath path="${build.dir}" />
<arg value="--warmupMillis" />
<arg value="1000" />
<arg value="--runMillis" />
<arg value="5000" />
<arg value="alignment.UnalignedMemoryAccessFibonacciBenchmark" />
<arg value="-Doffset=0,1,2,3,4,5,6,7,8,16,24,32,40,48,56,60" />
<arg value="-DsizeInPages=1,2,4,8,16,32,64,128,256,512,1024,2048" />
</java>
</target>
<target name="run-page-io" depends="build" description=" run experiments">
<ivy:cachepath pathid="lib.path.id" />
<echo message="running experiments..." />
<java classpathref="lib.path.id" classname="com.google.caliper.Runner" fork="true">
<classpath path="${build.dir}" />
<arg value="--trials" />
<arg value="10" />
<arg value="alignment.UnalignedPageIOBenchmark" />
</java>
</target>
<target name="clean" description="--> clean the project">
<delete includeemptydirs="true" quiet="true">
<fileset dir="${build.dir}" />
</delete>
</target>
<target name="clean-ivy" description="--> clean the ivy installation">
<delete dir="${ivy.jar.dir}" />
</target>
<target name="clean-cache" depends="install-ivy" description="--> clean the ivy cache">
<ivy:cleancache />
</target>
</project>