@@ -10,8 +10,10 @@ print_help () {
1010 echo " [--no-measure]"
1111 echo " [--append]"
1212 echo " [--long]"
13− echo " [--compare] [--base commit] [--candidate commit]"
1413 echo " [--slow]"
14+ echo " [--quick]"
15+ echo " [--compare] [--base commit] [--candidate commit]"
16+ echo " [--cabal-build-flags]"
1517 echo " -- <gauge options>"
1618 echo
1719 echo "Multiple benchmarks can be specified as a space separate list"
@@ -147,17 +149,25 @@ run_bench () {
147149
148150 echo "Running benchmark $bench_name ..."
149151
152+ local QUICK_OPTS="--quick --time-limit 1 --min-duration 0"
150153 local SPEED_OPTIONS
151154 if test "$LONG" -eq 0
152155 then
153156 if test "$SLOW" -eq 0
154157 then
155− SPEED_OPTIONS="--quick --min-samples 10 --time-limit 1 --min-duration 0"
158+ if test "$QUICK" -eq 0
159+ then
160+ # reasonably quick
161+ SPEED_OPTIONS="$QUICK_OPTS --min-samples 10"
162+ else
163+ # super quick but less accurate
164+ SPEED_OPTIONS="$QUICK_OPTS --include-first-iter"
165+ fi
156166 else
157167 SPEED_OPTIONS="--min-duration 0"
158168 fi
159169 else
160− SPEED_OPTIONS="--stream-size 10000000 -v2 --quick --include-first-iter --time-limit 1 --min-duration 0"
170+ SPEED_OPTIONS="--stream-size 10000000 $QUICK_OPTS --include-first-iter"
161171 fi
162172
163173 $bench_prog $SPEED_OPTIONS \
@@ -255,6 +265,7 @@ CANDIDATE=
255265
256266APPEND=0
257267SLOW=0
268+QUICK=0
258269LONG=0
259270RAW=0
260271GRAPH=0
@@ -263,6 +274,7 @@ MEASURE=1
263274GAUGE_ARGS=
264275BUILD_ONCE=0
265276USE_STACK=0
277+CABAL_BUILD_FLAGS=""
266278
267279GHC_VERSION=$(ghc --numeric-version)
268280
@@ -279,11 +291,13 @@ do
279291 case $1 in
280292 -h|--help|help) print_help ;;
281293 # options with arguments
282− --slow) SLOW=1; shift ;;
283294 --benchmarks) shift; BENCHMARKS=$1; shift ;;
284295 --base) shift; BASE=$1; shift ;;
285296 --candidate) shift; CANDIDATE=$1; shift ;;
297+ --cabal-build-flags) shift; CABAL_BUILD_FLAGS=$1; shift ;;
286298 # flags
299+ --slow) SLOW=1; shift ;;
300+ --quick) QUICK=1; shift ;;
287301 --compare) COMPARE=1; shift ;;
288302 --raw) RAW=1; shift ;;
289303 --append) APPEND=1; shift ;;
@@ -301,10 +315,11 @@ GAUGE_ARGS=$*
301315echo "Using stack command [$STACK]"
302316set_benchmarks
303317
318+# XXX we can remove these if we pass stack build flags from command line like
319+# cabal build flags.
304320if echo "$BENCHMARKS" | grep -q base
305321then
306322 STACK_BUILD_FLAGS="--flag streamly:dev"
307− CABAL_BUILD_FLAGS="--flags dev"
308323fi
309324
310325for i in $BENCHMARKS
@@ -312,7 +327,6 @@ do
312327 if test "$i" = concurrent
313328 then
314329 STACK_BUILD_FLAGS="--flag streamly:dev"
315− CABAL_BUILD_FLAGS="--flags dev"
316330 break
317331 fi
318332done