@@ -3,13 +3,16 @@
3print_help () {
3print_help () {
4 echo "Usage: $0 "
4 echo "Usage: $0 "
5 echo " [--compare] [--base commit] [--candidate commit]"
5 echo " [--compare] [--base commit] [--candidate commit]"
6− echo " [--benchmark <linear|linear-async|linear-rate|nested|base>]"
6+ echo " [--benchmarks <all|linear|linear-async|linear-rate|nested|base>]"
7 echo " [--graphs]"
7 echo " [--graphs]"
8 echo " [--slow]"
8 echo " [--slow]"
9 echo " [--no-measure]"
9 echo " [--no-measure]"
10 echo " [--append] "
10 echo " [--append] "
11 echo " -- <gauge options>"
11 echo " -- <gauge options>"
13+ echo "Multiple benchmarks can be specified as a space separate list"
14+ echo " e.g. --benchmarks \"linear nested\""
13 echo "When using --compare, by default comparative chart of HEAD^ vs HEAD"
16 echo "When using --compare, by default comparative chart of HEAD^ vs HEAD"
14 echo "commit is generated, in the 'charts' directory."
17 echo "commit is generated, in the 'charts' directory."
15 echo "Use --base and --candidate to select the commits to compare."
18 echo "Use --base and --candidate to select the commits to compare."
@@ -29,10 +32,11 @@ set_benchmarks() {
29 if test -z "$BENCHMARKS"
32 if test -z "$BENCHMARKS"
31 BENCHMARKS=$DEFAULT_BENCHMARKS
34 BENCHMARKS=$DEFAULT_BENCHMARKS
32− echo "Using default benchmark suite [$BENCHMARKS], use --benchmark to specify another"
35+ elif test "$BENCHMARKS" = "all"
34− echo "Using benchmark suite [$BENCHMARKS]"
37+ BENCHMARKS=$ALL_BENCHMARKS
39+ echo "Using benchmark suites [$BENCHMARKS]"
38# $1: benchmark name (linear, nested, base)
42# $1: benchmark name (linear, nested, base)
@@ -155,12 +159,14 @@ run_benches_comparing() {
155 echo "Checking out base commit [$BASE] for benchmarking"
159 echo "Checking out base commit [$BASE] for benchmarking"
156 git checkout "$BASE" || die "Checkout of base commit [$BASE] failed"
160 git checkout "$BASE" || die "Checkout of base commit [$BASE] failed"
162+ $STACK build --bench --no-run-benchmarks || die "build failed"
158 run_benches "$bench_list"
163 run_benches "$bench_list"
160 echo "Checking out candidate commit [$CANDIDATE] for benchmarking"
165 echo "Checking out candidate commit [$CANDIDATE] for benchmarking"
161 git checkout "$CANDIDATE" || \
166 git checkout "$CANDIDATE" || \
162 die "Checkout of candidate [$CANDIDATE] commit failed"
167 die "Checkout of candidate [$CANDIDATE] commit failed"
169+ $STACK build --bench --no-run-benchmarks || die "build failed"
164 run_benches "$bench_list"
170 run_benches "$bench_list"
165 # XXX reset back to the original commit
171 # XXX reset back to the original commit
@@ -209,6 +215,7 @@ run_reports() {
209#-----------------------------------------------------------------------------
215#-----------------------------------------------------------------------------
211DEFAULT_BENCHMARKS="linear"
217DEFAULT_BENCHMARKS="linear"
218+ALL_BENCHMARKS="linear linear-async linear-rate nested base"
@@ -235,7 +242,7 @@ do
235 -h|--help|help) print_help ;;
242 -h|--help|help) print_help ;;
236 --slow) SPEED_OPTIONS="--min-duration 0"; shift ;;
243 --slow) SPEED_OPTIONS="--min-duration 0"; shift ;;
237 --append) APPEND=1; shift ;;
244 --append) APPEND=1; shift ;;
238− --benchmark) shift; BENCHMARKS=$1; shift ;;
245+ --benchmarks) shift; BENCHMARKS=$1; shift ;;
239 --base) shift; BASE=$1; shift ;;
246 --base) shift; BASE=$1; shift ;;
240 --candidate) shift; CANDIDATE=$1; shift ;;
247 --candidate) shift; CANDIDATE=$1; shift ;;
241 --compare) COMPARE=1; shift ;;
248 --compare) COMPARE=1; shift ;;