@@ -10,8 +10,10 @@ print_help () {
10 echo " [--no-measure]"
10 echo " [--no-measure]"
11 echo " [--append]"
11 echo " [--append]"
12 echo " [--long]"
12 echo " [--long]"
13− echo " [--compare] [--base commit] [--candidate commit]"
14 echo " [--slow]"
13 echo " [--slow]"
15+ echo " [--compare] [--base commit] [--candidate commit]"
16+ echo " [--cabal-build-flags]"
15 echo " -- <gauge options>"
17 echo " -- <gauge options>"
17 echo "Multiple benchmarks can be specified as a space separate list"
19 echo "Multiple benchmarks can be specified as a space separate list"
@@ -147,17 +149,25 @@ run_bench () {
148 echo "Running benchmark $bench_name ..."
150 echo "Running benchmark $bench_name ..."
152+ local QUICK_OPTS="--quick --time-limit 1 --min-duration 0"
150 local SPEED_OPTIONS
153 local SPEED_OPTIONS
151 if test "$LONG" -eq 0
154 if test "$LONG" -eq 0
153 if test "$SLOW" -eq 0
156 if test "$SLOW" -eq 0
158+ if test "$QUICK" -eq 0
155− SPEED_OPTIONS="--quick --min-samples 10 --time-limit 1 --min-duration 0"
161+ SPEED_OPTIONS="$QUICK_OPTS --min-samples 10"
163+ # super quick but less accurate
164+ SPEED_OPTIONS="$QUICK_OPTS --include-first-iter"
157 SPEED_OPTIONS="--min-duration 0"
167 SPEED_OPTIONS="--min-duration 0"
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"
163 $bench_prog $SPEED_OPTIONS \
173 $bench_prog $SPEED_OPTIONS \
@@ -255,6 +265,7 @@ CANDIDATE=
@@ -263,6 +274,7 @@ MEASURE=1
263GAUGE_ARGS=
274GAUGE_ARGS=
264BUILD_ONCE=0
275BUILD_ONCE=0
265USE_STACK=0
276USE_STACK=0
267GHC_VERSION=$(ghc --numeric-version)
279GHC_VERSION=$(ghc --numeric-version)
@@ -279,11 +291,13 @@ do
279 case $1 in
291 case $1 in
280 -h|--help|help) print_help ;;
292 -h|--help|help) print_help ;;
281 # options with arguments
293 # options with arguments
282− --slow) SLOW=1; shift ;;
283 --benchmarks) shift; BENCHMARKS=$1; shift ;;
294 --benchmarks) shift; BENCHMARKS=$1; shift ;;
284 --base) shift; BASE=$1; shift ;;
295 --base) shift; BASE=$1; shift ;;
285 --candidate) shift; CANDIDATE=$1; shift ;;
296 --candidate) shift; CANDIDATE=$1; shift ;;
297+ --cabal-build-flags) shift; CABAL_BUILD_FLAGS=$1; shift ;;
299+ --slow) SLOW=1; shift ;;
300+ --quick) QUICK=1; shift ;;
287 --compare) COMPARE=1; shift ;;
301 --compare) COMPARE=1; shift ;;
288 --raw) RAW=1; shift ;;
302 --raw) RAW=1; shift ;;
289 --append) APPEND=1; shift ;;
303 --append) APPEND=1; shift ;;
@@ -301,10 +315,11 @@ GAUGE_ARGS=$*
301echo "Using stack command [$STACK]"
315echo "Using stack command [$STACK]"
302set_benchmarks
316set_benchmarks
318+# XXX we can remove these if we pass stack build flags from command line like
304if echo "$BENCHMARKS" | grep -q base
320if echo "$BENCHMARKS" | grep -q base
306 STACK_BUILD_FLAGS="--flag streamly:dev"
322 STACK_BUILD_FLAGS="--flag streamly:dev"
307− CABAL_BUILD_FLAGS="--flags dev"
310for i in $BENCHMARKS
325for i in $BENCHMARKS
@@ -312,7 +327,6 @@ do
312 if test "$i" = concurrent
327 if test "$i" = concurrent
314 STACK_BUILD_FLAGS="--flag streamly:dev"
329 STACK_BUILD_FLAGS="--flag streamly:dev"
315− CABAL_BUILD_FLAGS="--flags dev"