on master help sign in
Merge all the base* executables
commite7df8acee3baa5c12e304acdce07121b9d5f57ec authoradithyaov <adi.obilisetty@gmail.com> dateTue 28 Apr 2020, 07:49 (6 years ago) parent0d66526
3 files changed+26−67
bench.sh+13 benchmark/Streamly/Benchmark/Data/Stream/BaseStreams.hs+12−25 benchmark/streamly-benchmarks.cabal+1−42
bench.sh+13
@@ -34,6 +34,11 @@ bench_rts_opts () {
3434 "serial-o-n-stack") echo -n "-T -K1M -M16M" ;;
3535 "serial-o-n-heap") echo -n "-T -K36K -M128M" ;;
3636 "serial-o-n-space") echo -n "-T -K16M -M64M" ;;
37+ "base") echo -n "-T -K36K -M16M" ;;
38+ "base-o-n-stack") echo -n "-T -K1M -M16M" ;;
39+ "base-o-n-heap") echo -n "-T -K36K -M64M" ;;
40+ "base-o-n-space") echo -n "-T -K32M -M32M" ;;
41+
3742 *) echo -n "" ;;
3843 esac
3944}
@@ -49,6 +54,10 @@ bench_exec () {
4954 "serial-o-n-stack") echo -n "serial" ;;
5055 "serial-o-n-heap") echo -n "serial" ;;
5156 "serial-o-n-space") echo -n "serial" ;;
57+ "base") echo -n "base" ;;
58+ "base-o-n-stack") echo -n "base" ;;
59+ "base-o-n-heap") echo -n "base" ;;
60+ "base-o-n-space") echo -n "base" ;;
5261 *) echo -n "$1" ;;
5362 esac
5463}
@@ -64,6 +73,10 @@ bench_gauge_opts () {
6473 "serial-o-n-stack") echo -n "-m prefix o-n-stack" ;;
6574 "serial-o-n-heap") echo -n "-m prefix o-n-heap" ;;
6675 "serial-o-n-space") echo -n "-m prefix o-n-space" ;;
76+ "base") echo -n "-m prefix o-1-space" ;;
77+ "base-o-n-stack") echo -n "-m prefix o-n-stack" ;;
78+ "base-o-n-heap") echo -n "-m prefix o-n-heap" ;;
79+ "base-o-n-space") echo -n "-m prefix o-n-space" ;;
6780 *) echo -n "" ;;
6881 esac
6982}
benchmark/Streamly/Benchmark/Data/Stream/BaseStreams.hs+12−25
@@ -5,36 +5,23 @@
55-- License : BSD3
66-- Maintainer : streamly@composewell.com
77
8−{-# LANGUAGE CPP #-}
9−
108import qualified Streamly.Benchmark.Data.Stream.StreamK as K
11−
12−#if !defined(O_N_HEAP)
139import qualified Streamly.Benchmark.Data.Stream.StreamD as D
14−#endif
15−
16−#ifdef O_1_SPACE
1710import qualified Streamly.Benchmark.Data.Stream.StreamDK as DK
18−#endif
1911
2012import Gauge
2113
2214main :: IO ()
2315main =
24− defaultMain $
25−#ifdef O_1_SPACE
26− D.o_1_space
27− ++ K.o_1_space_list
28− ++ K.o_1_space
29− ++ DK.o_1_space
30−#elif defined(O_N_HEAP)
31− K.o_n_heap
32−#elif defined(O_N_STACK)
33− D.o_n_stack
34− ++ K.o_n_stack
35−#elif defined(O_N_SPACE)
36− D.o_n_space
37− ++ K.o_n_space
38−#else
39−#error "One of O_1_SPACE/O_N_HEAP/O_N_STACK/O_N_SPACE must be defined"
40−#endif
16+ defaultMain $
17+ [ bgroup "o-n-stack" o_n_stack
18+ , bgroup "o-1-space" o_1_space
19+ , bgroup "o-n-heap" o_n_heap
20+ , bgroup "o-n-space" o_n_space
21+ ]
22+ where
23+ o_1_space =
24+ concat [D.o_1_space, K.o_1_space_list, K.o_1_space, DK.o_1_space]
25+ o_n_heap = K.o_n_heap
26+ o_n_stack = concat [D.o_n_stack, K.o_n_stack]
27+ o_n_space = concat [D.o_n_space, K.o_n_space]
benchmark/streamly-benchmarks.cabal+1−42
@@ -263,50 +263,9 @@ library lib-base
263263 buildable: True
264264
265265benchmark base
266−-- benchmark base-o-1-space
267266 import: bench-options
268267 type: exitcode-stdio-1.0
269− cpp-options: -DO_1_SPACE
270− ghc-options: -with-rtsopts "-T -K36K -M16M"
271− hs-source-dirs: Streamly/Benchmark/Data/Stream
272− main-is: BaseStreams.hs
273− if impl(ghcjs)
274− buildable: False
275− else
276− build-depends: lib-base
277− buildable: True
278−
279−benchmark base-o-n-heap
280− import: bench-options
281− type: exitcode-stdio-1.0
282− cpp-options: -DO_N_HEAP
283− ghc-options: -with-rtsopts "-T -K36K -M64M"
284− hs-source-dirs: Streamly/Benchmark/Data/Stream
285− main-is: BaseStreams.hs
286− if impl(ghcjs)
287− buildable: False
288− else
289− build-depends: lib-base
290− buildable: True
291−
292−benchmark base-o-n-stack
293− import: bench-options
294− type: exitcode-stdio-1.0
295− cpp-options: -DO_N_STACK
296− ghc-options: -with-rtsopts "-T -K1M -M16M"
297− hs-source-dirs: Streamly/Benchmark/Data/Stream
298− main-is: BaseStreams.hs
299− if impl(ghcjs)
300− buildable: False
301− else
302− build-depends: lib-base
303− buildable: True
304−
305−benchmark base-o-n-space
306− import: bench-options
307− type: exitcode-stdio-1.0
308− cpp-options: -DO_N_SPACE
309− ghc-options: -with-rtsopts "-T -K32M -M32M"
268+ ghc-options: -rtsopts
310269 hs-source-dirs: Streamly/Benchmark/Data/Stream
311270 main-is: BaseStreams.hs
312271 if impl(ghcjs)