on master help sign in
Merge all the base* executables
e7df8acadithyaov
bench.sh+13
@@ -34,6 +34,11 @@ bench_rts_opts () {
34 "serial-o-n-stack") echo -n "-T -K1M -M16M" ;;
34 "serial-o-n-stack") echo -n "-T -K1M -M16M" ;;
35 "serial-o-n-heap") echo -n "-T -K36K -M128M" ;;
35 "serial-o-n-heap") echo -n "-T -K36K -M128M" ;;
36 "serial-o-n-space") echo -n "-T -K16M -M64M" ;;
36 "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+
37 *) echo -n "" ;;
42 *) echo -n "" ;;
38 esac
43 esac
39}
44}
@@ -49,6 +54,10 @@ bench_exec () {
49 "serial-o-n-stack") echo -n "serial" ;;
54 "serial-o-n-stack") echo -n "serial" ;;
50 "serial-o-n-heap") echo -n "serial" ;;
55 "serial-o-n-heap") echo -n "serial" ;;
51 "serial-o-n-space") echo -n "serial" ;;
56 "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" ;;
52 *) echo -n "$1" ;;
61 *) echo -n "$1" ;;
53 esac
62 esac
54}
63}
@@ -64,6 +73,10 @@ bench_gauge_opts () {
64 "serial-o-n-stack") echo -n "-m prefix o-n-stack" ;;
73 "serial-o-n-stack") echo -n "-m prefix o-n-stack" ;;
65 "serial-o-n-heap") echo -n "-m prefix o-n-heap" ;;
74 "serial-o-n-heap") echo -n "-m prefix o-n-heap" ;;
66 "serial-o-n-space") echo -n "-m prefix o-n-space" ;;
75 "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" ;;
67 *) echo -n "" ;;
80 *) echo -n "" ;;
68 esac
81 esac
69}
82}
benchmark/Streamly/Benchmark/Data/Stream/BaseStreams.hs+12−25
@@ -5,36 +5,23 @@
5-- License : BSD3
5-- License : BSD3
6-- Maintainer : streamly@composewell.com
6-- Maintainer : streamly@composewell.com
7
7
8−{-# LANGUAGE CPP #-}
9−
10import qualified Streamly.Benchmark.Data.Stream.StreamK as K
8import qualified Streamly.Benchmark.Data.Stream.StreamK as K
11−
12−#if !defined(O_N_HEAP)
13import qualified Streamly.Benchmark.Data.Stream.StreamD as D
9import qualified Streamly.Benchmark.Data.Stream.StreamD as D
14−#endif
15−
16−#ifdef O_1_SPACE
17import qualified Streamly.Benchmark.Data.Stream.StreamDK as DK
10import qualified Streamly.Benchmark.Data.Stream.StreamDK as DK
18−#endif
19
11
20import Gauge
12import Gauge
21
13
22main :: IO ()
14main :: IO ()
23main =
15main =
24− defaultMain $
16+ defaultMain $
25−#ifdef O_1_SPACE
17+ [ bgroup "o-n-stack" o_n_stack
26− D.o_1_space
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 =
27− ++ K.o_1_space_list
24+ concat [D.o_1_space, K.o_1_space_list, K.o_1_space, DK.o_1_space]
28− ++ K.o_1_space
29− ++ DK.o_1_space
30−#elif defined(O_N_HEAP)
31− K.o_n_heap
25+ o_n_heap = K.o_n_heap
32−#elif defined(O_N_STACK)
33− D.o_n_stack
26+ o_n_stack = concat [D.o_n_stack, K.o_n_stack]
34− ++ K.o_n_stack
35−#elif defined(O_N_SPACE)
36− D.o_n_space
27+ o_n_space = concat [D.o_n_space, K.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
benchmark/streamly-benchmarks.cabal+1−42
@@ -263,50 +263,9 @@ library lib-base
263 buildable: True
263 buildable: True
264
264
265benchmark base
265benchmark base
266−-- benchmark base-o-1-space
267 import: bench-options
266 import: bench-options
268 type: exitcode-stdio-1.0
267 type: exitcode-stdio-1.0
269− cpp-options: -DO_1_SPACE
270− ghc-options: -with-rtsopts "-T -K36K -M16M"
268+ ghc-options: -rtsopts
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"
310 hs-source-dirs: Streamly/Benchmark/Data/Stream
269 hs-source-dirs: Streamly/Benchmark/Data/Stream
311 main-is: BaseStreams.hs
270 main-is: BaseStreams.hs
312 if impl(ghcjs)
271 if impl(ghcjs)