mirror of
https://github.com/composewell/streamly.git
synced 2024-09-11 11:37:22 +03:00
Add FileSystem.Handle benchmark, use --time-limit 0
In the quick mode we anyway use --include-first-iter, we should not be running many iterations, one iteration is enough, anyway allocations do not change across iterations. We can use this for super quick comparison of benchmarks.
This commit is contained in:
parent
89b9e233ba
commit
37bcdcd34d
16
bench.sh
16
bench.sh
@ -1,11 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Note "_grp" and "_cmp" suffixes are special, do not rename them to something
|
||||
# else.
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Benchmark groups
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# IMPORTANT NOTE: the names "_grp" and "_cmp" suffixes are special, do
|
||||
# not rename them to something else.
|
||||
|
||||
base_stream_grp="\
|
||||
Data.Stream.StreamD \
|
||||
Data.Stream.StreamK \
|
||||
@ -72,7 +73,8 @@ all_grp="\
|
||||
$prelude_concurrent_grp \
|
||||
$array_grp \
|
||||
$parser_grp \
|
||||
Data.Unfold"
|
||||
Data.Unfold \
|
||||
FileSystem.Handle"
|
||||
|
||||
ALL_BENCH_GROUPS="\
|
||||
all_grp \
|
||||
@ -287,7 +289,7 @@ run_bench () {
|
||||
|
||||
echo "Running benchmark $bench_name ..."
|
||||
|
||||
local QUICK_OPTS="--quick --time-limit 1 --min-duration 0"
|
||||
local QUICK_OPTS="--quick --min-duration 0"
|
||||
local SPEED_OPTIONS
|
||||
if test "$LONG" -eq 0
|
||||
then
|
||||
@ -297,10 +299,10 @@ run_bench () {
|
||||
if test "$QUICK_MODE" -eq 0
|
||||
then
|
||||
# default mode, not super quick, not slow
|
||||
SPEED_OPTIONS="$QUICK_OPTS --min-samples 10"
|
||||
SPEED_OPTIONS="$QUICK_OPTS --min-samples 10 --time-limit 1"
|
||||
else
|
||||
# super quick but less accurate
|
||||
SPEED_OPTIONS="$QUICK_OPTS --include-first-iter"
|
||||
SPEED_OPTIONS="$QUICK_OPTS --time-limit 0 --include-first-iter"
|
||||
fi
|
||||
else
|
||||
# Slow but more accurate mode
|
||||
|
@ -80,21 +80,26 @@ bench_rts_opts_specific () {
|
||||
# Speed options
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if test -n "$QUICK_MODE"
|
||||
then
|
||||
if test "$QUICK_MODE" -eq 0
|
||||
SUPER_QUICK_OPTIONS="--quick --min-duration 0 --time-limit 0 --include-first-iter"
|
||||
QUICKER_OPTIONS="--min-samples 3 --time-limit 1"
|
||||
|
||||
# For certain long benchmarks if the user has not requested super quick
|
||||
# mode we anyway use a slightly quicker mode.
|
||||
use_quicker_mode () {
|
||||
if test -n "$QUICK_MODE"
|
||||
then
|
||||
QUICK_OPTIONS="--min-samples 3"
|
||||
if test "$QUICK_MODE" -eq 0
|
||||
then
|
||||
echo $QUICKER_OPTIONS
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
SUPER_QUICK_OPTIONS="--min-samples 1 --include-first-iter"
|
||||
}
|
||||
|
||||
bench_exe_quick_opts () {
|
||||
case "$1" in
|
||||
Prelude.Concurrent) echo -n "$SUPER_QUICK_OPTIONS" ;;
|
||||
Prelude.Rate) echo -n "$SUPER_QUICK_OPTIONS" ;;
|
||||
Prelude.Adaptive) echo -n "$SUPER_QUICK_OPTIONS" ;;
|
||||
fileio) echo -n "$SUPER_QUICK_OPTIONS" ;;
|
||||
*) echo -n "" ;;
|
||||
esac
|
||||
}
|
||||
@ -108,18 +113,20 @@ bench_quick_opts () {
|
||||
echo -n "$SUPER_QUICK_OPTIONS" ;;
|
||||
Prelude.Parallel/o-n-space/monad-outer-product/*)
|
||||
echo -n "$SUPER_QUICK_OPTIONS" ;;
|
||||
Prelude.Parallel/o-n-heap/generation/*) echo -n "$QUICK_OPTIONS" ;;
|
||||
Prelude.Parallel/o-n-heap/mapping/*) echo -n "$QUICK_OPTIONS" ;;
|
||||
Prelude.Parallel/o-n-heap/concat-foldable/*) echo -n "$QUICK_OPTIONS" ;;
|
||||
Prelude.Parallel/o-n-heap/generation/*) use_quicker_mode ;;
|
||||
Prelude.Parallel/o-n-heap/mapping/*) use_quicker_mode ;;
|
||||
Prelude.Parallel/o-n-heap/concat-foldable/*) use_quicker_mode ;;
|
||||
|
||||
Prelude.Async/o-1-space/monad-outer-product/*) echo -n "$QUICK_OPTIONS" ;;
|
||||
Prelude.Async/o-n-space/monad-outer-product/*) echo -n "$QUICK_OPTIONS" ;;
|
||||
Prelude.Async/o-1-space/monad-outer-product/*) use_quicker_mode ;;
|
||||
Prelude.Async/o-n-space/monad-outer-product/*) use_quicker_mode ;;
|
||||
|
||||
Prelude.Ahead/o-1-space/monad-outer-product/*) echo -n "$QUICK_OPTIONS" ;;
|
||||
Prelude.Ahead/o-n-space/monad-outer-product/*) echo -n "$QUICK_OPTIONS" ;;
|
||||
Prelude.Ahead/o-1-space/monad-outer-product/*) use_quicker_mode ;;
|
||||
Prelude.Ahead/o-n-space/monad-outer-product/*) use_quicker_mode ;;
|
||||
|
||||
Prelude.WAsync/o-n-heap/monad-outer-product/*) echo -n "$QUICK_OPTIONS" ;;
|
||||
Prelude.WAsync/o-n-space/monad-outer-product/*) echo -n "$QUICK_OPTIONS" ;;
|
||||
Prelude.WAsync/o-n-heap/monad-outer-product/*) use_quicker_mode ;;
|
||||
Prelude.WAsync/o-n-space/monad-outer-product/*) use_quicker_mode ;;
|
||||
|
||||
FileSystem.Handle/*) use_quicker_mode ;;
|
||||
*) echo -n "" ;;
|
||||
esac
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user