@@ -3,8 +3,9 @@
3SERIAL_O_1="linear base"
3SERIAL_O_1="linear base"
4SERIAL_O_n="serial-o-n-heap serial-o-n-stack serial-o-n-space \
4SERIAL_O_n="serial-o-n-heap serial-o-n-stack serial-o-n-space \
5 base-o-n-heap base-o-n-stack base-o-n-space"
5 base-o-n-heap base-o-n-stack base-o-n-space"
6+FOLD_BENCHMARKS="fold-o-1-space fold-o-n-heap"
7−SERIAL_BENCHMARKS="$SERIAL_O_1 $SERIAL_O_n"
8+SERIAL_BENCHMARKS="$SERIAL_O_1 $SERIAL_O_n $FOLD_BENCHMARKS"
8# parallel benchmark-suite is separated because we run it with a higher
9# parallel benchmark-suite is separated because we run it with a higher
9# heap size limit.
10# heap size limit.
10CONCURRENT_BENCHMARKS="linear-async linear-rate nested-concurrent parallel concurrent adaptive"
11CONCURRENT_BENCHMARKS="linear-async linear-rate nested-concurrent parallel concurrent adaptive"
@@ -21,6 +22,33 @@ VIRTUAL_BENCHMARKS="array-cmp"
22ALL_BENCHMARKS="$SERIAL_BENCHMARKS $CONCURRENT_BENCHMARKS $ARRAY_BENCHMARKS $VIRTUAL_BENCHMARKS"
23ALL_BENCHMARKS="$SERIAL_BENCHMARKS $CONCURRENT_BENCHMARKS $ARRAY_BENCHMARKS $VIRTUAL_BENCHMARKS"
25+# RTS options that go inside +RTS and -RTS while running the benchmark.
28+ "fold-o-1-space") echo -n "-T -K36K -M16M" ;;
29+ "fold-o-n-heap") echo -n "-T -K36K -M128M" ;;
34+# The correct executable for the given benchmark name.
37+ "fold-o-1-space") echo -n "fold" ;;
38+ "fold-o-n-heap") echo -n "fold" ;;
43+# Specific gauge options for the given benchmark.
46+ "fold-o-1-space") echo -n "-m prefix o-1-space" ;;
47+ "fold-o-n-heap") echo -n "-m prefix o-n-heap" ;;
24list_benches () {
52list_benches () {
25 for i in $ALL_BENCHMARKS
53 for i in $ALL_BENCHMARKS
@@ -177,10 +205,11 @@ bench_output_file() {
178run_bench () {
206run_bench () {
179 local bench_name=$1
207 local bench_name=$1
208+ local bench_exe=$(bench_exec $bench_name)
180 local output_file=$(bench_output_file $bench_name)
209 local output_file=$(bench_output_file $bench_name)
181 local bench_prog
210 local bench_prog
182 local quick_bench=0
211 local quick_bench=0
183− bench_prog=$($GET_BENCH_PROG $bench_name) || \
212+ bench_prog=$($GET_BENCH_PROG $bench_exe) || \
184 die "Cannot find benchmark executable for benchmark $bench_name"
213 die "Cannot find benchmark executable for benchmark $bench_name"
186 mkdir -p `dirname $output_file`
215 mkdir -p `dirname $output_file`
@@ -217,9 +246,11 @@ run_bench () {
219 $bench_prog $SPEED_OPTIONS \
248 $bench_prog $SPEED_OPTIONS \
249+ +RTS $(bench_rts_opts $bench_name) -RTS \
220 --csvraw=$output_file \
250 --csvraw=$output_file \
222− --measure-with $bench_prog $GAUGE_ARGS || die "Benchmarking failed"
252+ --measure-with $bench_prog $GAUGE_ARGS \
253+ $(bench_gauge_opts $bench_name) || die "Benchmarking failed"
225run_benches() {
256run_benches() {
@@ -382,8 +413,17 @@ only_real_benchmarks () {
416+proper_executables () {
417+ for i in $BENCHMARKS
419+ echo -n "$(bench_exec $i) "
385BENCHMARKS_ORIG=$BENCHMARKS
424BENCHMARKS_ORIG=$BENCHMARKS
386BENCHMARKS=$(only_real_benchmarks)
425BENCHMARKS=$(only_real_benchmarks)
426+EXECUTABLES=$(proper_executables)
387echo "Using benchmark suites [$BENCHMARKS]"
427echo "Using benchmark suites [$BENCHMARKS]"
389has_benchmark () {
429has_benchmark () {
@@ -431,7 +471,7 @@ then
432 $BUILD_BENCH || die "build failed"
472 $BUILD_BENCH || die "build failed"
434− $BUILD_BENCH $BENCHMARKS || die "build failed"
474+ $BUILD_BENCH $EXECUTABLES || die "build failed"
436 run_measurements "$BENCHMARKS"
476 run_measurements "$BENCHMARKS"