@@ -262,7 +262,7 @@ common exe-options
262262-- XXX dependencies should be separated under bench-depends
263263common bench-options
264264 import: compile-options, optimization-options
265− ghc-options: -with-rtsopts "-T -M256M"
265+ ghc-options: -with-rtsopts "-T -K32K -M16M"
266266 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
267267 ghc-options: -fplugin Fusion.Plugin
268268 build-depends:
@@ -273,7 +273,7 @@ common bench-options-threaded
273273 import: compile-options, optimization-options
274274 -- -threaded and -N2 is important because some GC and space leak issues
275275 -- trigger only with these options.
276− ghc-options: -threaded -with-rtsopts "-T -N2 -M256M"
276+ ghc-options: -threaded -with-rtsopts "-T -N2 -K32K -M16M"
277277 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
278278 ghc-options: -fplugin Fusion.Plugin
279279 build-depends:
@@ -670,6 +670,9 @@ benchmark linear
670670 import: bench-options
671671 type: exitcode-stdio-1.0
672672 hs-source-dirs: benchmark
673+ -- XXX heap/stack limits can be reduced once we split out the buffered
674+ -- benchmarks into a separate suite
675+ ghc-options: -with-rtsopts "-T -K4M -M128M"
673676 main-is: Linear.hs
674677 other-modules: Streamly.Benchmark.Prelude, Common
675678 build-depends:
@@ -689,6 +692,7 @@ benchmark nested
689692 import: bench-options
690693 type: exitcode-stdio-1.0
691694 hs-source-dirs: benchmark
695+ ghc-options: -with-rtsopts "-T -K256K -M16M"
692696 main-is: Nested.hs
693697 other-modules: NestedOps, Common
694698 build-depends:
@@ -705,6 +709,7 @@ benchmark nested-unfold
705709 import: bench-options
706710 type: exitcode-stdio-1.0
707711 hs-source-dirs: benchmark
712+ ghc-options: -with-rtsopts "-T -K64K -M16M"
708713 main-is: NestedUnfold.hs
709714 other-modules: NestedUnfoldOps, Common
710715 build-depends:
@@ -721,6 +726,7 @@ benchmark unpinned-array
721726 import: bench-options
722727 type: exitcode-stdio-1.0
723728 hs-source-dirs: benchmark
729+ ghc-options: -with-rtsopts "-T -K1K -M128M"
724730 main-is: Streamly/Benchmark/Data/Array.hs
725731 other-modules: Streamly.Benchmark.Data.ArrayOps
726732 build-depends:
@@ -737,6 +743,7 @@ benchmark prim-array
737743 import: bench-options
738744 type: exitcode-stdio-1.0
739745 hs-source-dirs: benchmark
746+ ghc-options: -with-rtsopts "-T -K64K -M32M"
740747 main-is: Streamly/Benchmark/Data/Prim/Array.hs
741748 other-modules: Streamly.Benchmark.Data.Prim.ArrayOps
742749 build-depends:
@@ -753,6 +760,7 @@ benchmark small-array
753760 import: bench-options
754761 type: exitcode-stdio-1.0
755762 hs-source-dirs: benchmark
763+ ghc-options: -with-rtsopts "-T -K128K -M16M"
756764 main-is: Streamly/Benchmark/Data/SmallArray.hs
757765 other-modules: Streamly.Benchmark.Data.SmallArrayOps
758766 build-depends:
@@ -769,6 +777,7 @@ benchmark array
769777 import: bench-options
770778 type: exitcode-stdio-1.0
771779 hs-source-dirs: benchmark
780+ ghc-options: -with-rtsopts "-T -K64K -M128M"
772781 main-is: Array.hs
773782 other-modules: ArrayOps
774783 build-depends:
@@ -809,6 +818,7 @@ benchmark linear-async
809818 import: bench-options-threaded
810819 type: exitcode-stdio-1.0
811820 hs-source-dirs: benchmark
821+ ghc-options: -with-rtsopts "-T -N2 -K64K -M16M"
812822 main-is: LinearAsync.hs
813823 other-modules: Streamly.Benchmark.Prelude, Common
814824 build-depends:
@@ -828,6 +838,8 @@ benchmark nested-concurrent
828838 import: bench-options-threaded
829839 type: exitcode-stdio-1.0
830840 hs-source-dirs: benchmark
841+ -- XXX this can be lowered once we split out the finite benchmarks
842+ ghc-options: -with-rtsopts "-T -N2 -K256K -M128M"
831843 main-is: NestedConcurrent.hs
832844 other-modules: NestedOps, Common
833845 build-depends:
@@ -844,6 +856,7 @@ benchmark parallel
844856 import: bench-options-threaded
845857 type: exitcode-stdio-1.0
846858 hs-source-dirs: benchmark
859+ ghc-options: -with-rtsopts "-T -N2 -K128K -M256M"
847860 main-is: Parallel.hs
848861 other-modules: Streamly.Benchmark.Prelude, NestedOps, Common
849862 build-depends:
@@ -883,14 +896,11 @@ benchmark concurrent
883896 type: exitcode-stdio-1.0
884897 hs-source-dirs: benchmark
885898 main-is: Concurrent.hs
886− if flag(dev)
887− buildable: True
888− build-depends:
889− streamly
890− , base >= 4.8 && < 5
891− , gauge >= 0.2.4 && < 0.3
892− else
893− buildable: False
899+ ghc-options: -with-rtsopts "-T -N2 -K256K -M384M"
900+ build-depends:
901+ streamly
902+ , base >= 4.8 && < 5
903+ , gauge >= 0.2.4 && < 0.3
894904
895905-------------------------------------------------------------------------------
896906-- Internal benchmarks
@@ -900,21 +910,22 @@ benchmark base
900910 import: bench-options
901911 type: exitcode-stdio-1.0
902912 hs-source-dirs: benchmark
913+ if flag(dev)
914+ cpp-options: -DDEVBUILD
915+ ghc-options: -with-rtsopts "-T -K2M -M16M"
916+ else
917+ ghc-options: -with-rtsopts "-T -K128K -M16M"
903918 main-is: BaseStreams.hs
904919 other-modules: StreamDOps
905920 , StreamKOps
906921 , StreamDKOps
907922
908− if flag(dev)
909− buildable: True
910− build-depends:
923+ build-depends:
911924 streamly
912925 , base >= 4.8 && < 5
913926 , deepseq >= 1.4.1 && < 1.5
914927 , random >= 1.0 && < 2.0
915928 , gauge >= 0.2.4 && < 0.3
916− else
917− buildable: False
918929
919930executable nano-bench
920931 import: bench-options
@@ -931,20 +942,16 @@ executable nano-bench
931942 buildable: False
932943
933944benchmark adaptive
934− import: bench-options
945+ import: bench-options-threaded
935946 type: exitcode-stdio-1.0
936947 hs-source-dirs: benchmark
937948 main-is: Adaptive.hs
938949 default-language: Haskell2010
939− if flag(dev)
940− buildable: True
941− build-depends:
942− streamly
943− , base >= 4.8 && < 5
944− , gauge >= 0.2.4 && < 0.3
945− , random >= 1.0 && < 2.0
946− else
947− buildable: False
950+ build-depends:
951+ streamly
952+ , base >= 4.8 && < 5
953+ , gauge >= 0.2.4 && < 0.3
954+ , random >= 1.0 && < 2.0
948955
949956executable chart
950957 default-language: Haskell2010