Permalink
Browse files

Initial version.

  • Loading branch information...
ijuma committed Oct 25, 2009
1 parent e3dabec commit 59521431f5c118b73e35b0b396e3efd6aecec3dd
View
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/scala"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="con" path="ch.epfl.lamp.sdt.launching.SCALA_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
View
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>benchmark</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>ch.epfl.lamp.sdt.core.scalabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>ch.epfl.lamp.sdt.core.scalanature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
View
@@ -0,0 +1,56 @@
export CP=~/src/scala/build/quick/classes/library/:../target
export J_OPTS="-Xms1G -Xmx1G -XX:+UseCompressedOops -XX:+DoEscapeAnalysis -XX:+UseParallelGC -XX:+UseParallelOldGC"
export OUTPUT=../output/timingsScript.txt
export RUNS=250
java $J_OPTS -cp $CP rompf.BenchARawArrayIndexed 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchARawArrayForeach 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchARawArrayForeachMega 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchARawArrayIte 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAArrayIndexed 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAArrayIter 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAListIter 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAListForeach 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAListHeadTail 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAVectorForeach 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAVectorForeachFastProtect 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAVectorHeadTail 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAVectorHeadTailAlt 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAVectorHeadTailBlt 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAVectorHeadTailClt 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAVectorHeadTailStub 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAVectorIndexed 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAVectorIndexedFast 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchAVectorIter 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchBListForeach 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchBListHeadTail 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchBListIter 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchBVectorForeach 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchBVectorForeachFast 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchBVectorForeachFastProtect 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchBVectorIndexedFast 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchBVectorIter 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchCArrayIter 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchCListHeadTail 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchCVectorForeach 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchCVectorHeadTail 5 $OUTPUT $RUNS
java $J_OPTS -cp $CP rompf.BenchCVectorIter 5 $OUTPUT $RUNS
#osascript -e 'beep(10)'
@@ -0,0 +1,78 @@
package rompf;
/* Initially retrieved from http://lamp.epfl.ch/~rompf/vector2/ */
final class ArrayHelper {
static final Object[] asInstanceOfAnyRefArray(Object o) {
return (Object[])o;
}
static final void gotoZero(Object[][] display, int depth, Object[] elems) {
switch (depth - 1) { // goto pos zero
case 5:
display[5] = elems;
display[4] = (Object[])display[5][0];
display[3] = (Object[])display[4][0];
display[2] = (Object[])display[3][0];
display[1] = (Object[])display[2][0];
display[0] = (Object[])display[1][0];
break;
case 4:
display[4] = elems;
display[3] = (Object[])display[4][0];
display[2] = (Object[])display[3][0];
display[1] = (Object[])display[2][0];
display[0] = (Object[])display[1][0];
break;
case 3:
display[3] = elems;
display[2] = (Object[])display[3][0];
display[1] = (Object[])display[2][0];
display[0] = (Object[])display[1][0];
break;
case 2:
display[2] = elems;
display[1] = (Object[])display[2][0];
display[0] = (Object[])display[1][0];
break;
case 1:
display[1] = elems;
display[0] = (Object[])display[1][0];
break;
case 0:
display[0] = elems;
break;
}
}
static final void gotoPos(int index, int xor, Object[][] display) {
if (xor < (1 << 10)) { // level = 1
display[0] = (Object[])display[1][(index >> 5) & 31];
} else
if (xor < (1 << 15)) { // level = 2
display[1] = (Object[])display[2][(index >> 10) & 31];
display[0] = (Object[])display[1][0];
} else
if (xor < (1 << 20)) { // level = 3
display[2] = (Object[])display[3][(index >> 15) & 31];
display[1] = (Object[])display[2][0];
display[0] = (Object[])display[1][0];
} else
if (xor < (1 << 25)) { // level = 4
display[3] = (Object[])display[4][(index >> 20) & 31];
display[2] = (Object[])display[3][0];
display[1] = (Object[])display[2][0];
display[0] = (Object[])display[1][0];
} else
if (xor < (1 << 30)) { // level = 5
display[4] = (Object[])display[5][(index >> 25) & 31];
display[3] = (Object[])display[4][0];
display[2] = (Object[])display[3][0];
display[1] = (Object[])display[2][0];
display[0] = (Object[])display[1][0];
}// else { // level = 6
}
}
Oops, something went wrong.

0 comments on commit 5952143

Please sign in to comment.