@@ -261,7 +261,16 @@ library
261261 , Streamly.Benchmark.FileIO.Stream
262262
263263 default-language: Haskell2010
264− ghc-options: -Wall -O2 -fspec-constr-recursive=10
264+ -- We need optimization options here to optimize internal (non-inlined)
265+ -- versions of functions. Also, we have some benchmarking inspection tests
266+ -- part of the library when built with --benchmarks flag. Thos tests fail
267+ -- if we do not use optimization options here. It was observed that due to
268+ -- -O2 here some concurrent/nested benchmarks improved and others regressed.
269+ -- We can investigate a bit more here why the regression occurred.
270+ ghc-options: -Wall
271+ -O2
272+ -fspec-constr-recursive=10
273+ -fmax-worker-args=16
265274
266275 if flag(has-llvm)
267276 ghc-options: -fllvm
@@ -562,7 +571,11 @@ benchmark linear
562571 main-is: Linear.hs
563572 other-modules: LinearOps
564573 default-language: Haskell2010
565− ghc-options: -O2 -Wall -with-rtsopts "-T" -fspec-constr-recursive=10
574+ ghc-options: -O2
575+ -fspec-constr-recursive=10
576+ -fmax-worker-args=16
577+ -Wall
578+ -with-rtsopts "-T"
566579
567580 if flag(has-llvm)
568581 ghc-options: -fllvm
@@ -596,7 +609,11 @@ benchmark linear-async
596609 main-is: LinearAsync.hs
597610 other-modules: LinearOps
598611 default-language: Haskell2010
599− ghc-options: -O2 -Wall -fspec-constr-recursive=10 -with-rtsopts "-T"
612+ ghc-options: -O2
613+ -fspec-constr-recursive=10
614+ -fmax-worker-args=16
615+ -Wall
616+ -with-rtsopts "-T"
600617
601618 if flag(has-llvm)
602619 ghc-options: -fllvm
@@ -631,7 +648,11 @@ benchmark linear-rate
631648 main-is: LinearRate.hs
632649 other-modules: LinearOps
633650 default-language: Haskell2010
634− ghc-options: -O2 -Wall -fspec-constr-recursive=10 -with-rtsopts "-T"
651+ ghc-options: -O2
652+ -fspec-constr-recursive=10
653+ -fmax-worker-args=16
654+ -Wall
655+ -with-rtsopts "-T"
635656
636657 if flag(has-llvm)
637658 ghc-options: -fllvm
@@ -665,7 +686,11 @@ benchmark nested
665686 main-is: Nested.hs
666687 other-modules: NestedOps
667688 default-language: Haskell2010
668− ghc-options: -O2 -Wall -fspec-constr-recursive=10 -with-rtsopts "-T"
689+ ghc-options: -O2
690+ -fspec-constr-recursive=10
691+ -fmax-worker-args=16
692+ -Wall
693+ -with-rtsopts "-T"
669694
670695 if flag(has-llvm)
671696 ghc-options: -fllvm
@@ -700,7 +725,11 @@ benchmark array
700725 main-is: Array.hs
701726 other-modules: ArrayOps
702727 default-language: Haskell2010
703− ghc-options: -O2 -Wall -with-rtsopts "-T" -fspec-constr-recursive=10
728+ ghc-options: -O2
729+ -fspec-constr-recursive=10
730+ -fmax-worker-args=16
731+ -Wall
732+ -with-rtsopts "-T"
704733
705734 if flag(has-llvm)
706735 ghc-options: -fllvm
@@ -734,7 +763,11 @@ benchmark fileio
734763 hs-source-dirs: benchmark
735764 main-is: FileIO.hs
736765 default-language: Haskell2010
737− ghc-options: -O2 -Wall -fspec-constr-recursive=10 -with-rtsopts "-T"
766+ ghc-options: -O2
767+ -fspec-constr-recursive=10
768+ -fmax-worker-args=16
769+ -Wall
770+ -with-rtsopts "-T"
738771
739772 if flag(has-llvm)
740773 ghc-options: -fllvm
@@ -770,7 +803,11 @@ benchmark concurrent
770803 hs-source-dirs: benchmark
771804 main-is: Concurrent.hs
772805 default-language: Haskell2010
773− ghc-options: -O2 -Wall -fspec-constr-recursive=10 -with-rtsopts "-T"
806+ ghc-options: -O2
807+ -fspec-constr-recursive=10
808+ -fmax-worker-args=16
809+ -Wall
810+ -with-rtsopts "-T"
774811
775812 if flag(has-llvm)
776813 ghc-options: -fllvm
@@ -830,7 +867,11 @@ benchmark base
830867 , StreamKOps
831868
832869 default-language: Haskell2010
833− ghc-options: -O2 -Wall -fspec-constr-recursive=10 -with-rtsopts "-T"
870+ ghc-options: -O2
871+ -fspec-constr-recursive=10
872+ -fmax-worker-args=16
873+ -Wall
874+ -with-rtsopts "-T"
834875
835876 if flag(has-llvm)
836877 ghc-options: -fllvm
@@ -896,7 +937,11 @@ executable nano-bench
896937 , Streamly.FileSystem.IOVec
897938 , Streamly.Streams.StreamD
898939 default-language: Haskell2010
899− ghc-options: -O2 -Wall -with-rtsopts "-T"
940+ ghc-options: -O2
941+ -fspec-constr-recursive=10
942+ -fmax-worker-args=16
943+ -Wall
944+ -with-rtsopts "-T"
900945
901946 if flag(has-llvm)
902947 ghc-options: -fllvm
@@ -928,7 +973,11 @@ executable adaptive
928973 hs-source-dirs: benchmark
929974 main-is: Adaptive.hs
930975 default-language: Haskell2010
931− ghc-options: -O2 -Wall -with-rtsopts "-T"
976+ ghc-options: -O2
977+ -fspec-constr-recursive=10
978+ -fmax-worker-args=16
979+ -Wall
980+ -with-rtsopts "-T"
932981
933982 if flag(has-llvm)
934983 ghc-options: -fllvm
@@ -965,7 +1014,11 @@ executable SearchQuery
9651014 default-language: Haskell2010
9661015 main-is: SearchQuery.hs
9671016 hs-source-dirs: examples
968− ghc-options: -Wall
1017+ ghc-options: -O2
1018+ -fspec-constr-recursive=10
1019+ -fmax-worker-args=16
1020+ -Wall
1021+ -with-rtsopts "-T"
9691022 if (flag(examples) || flag(examples-sdl)) && !impl(ghcjs)
9701023 buildable: True
9711024 build-Depends:
@@ -979,7 +1032,11 @@ executable ListDir
9791032 default-language: Haskell2010
9801033 main-is: ListDir.hs
9811034 hs-source-dirs: examples
982− ghc-options: -Wall
1035+ ghc-options: -O2
1036+ -fspec-constr-recursive=10
1037+ -fmax-worker-args=16
1038+ -Wall
1039+ -with-rtsopts "-T"
9831040 if flag(examples) || flag(examples-sdl)
9841041 buildable: True
9851042 build-Depends:
@@ -996,7 +1053,11 @@ executable MergeSort
9961053 default-language: Haskell2010
9971054 main-is: MergeSort.hs
9981055 hs-source-dirs: examples
999− ghc-options: -Wall
1056+ ghc-options: -O2
1057+ -fspec-constr-recursive=10
1058+ -fmax-worker-args=16
1059+ -Wall
1060+ -with-rtsopts "-T"
10001061 if flag(examples) || flag(examples-sdl)
10011062 buildable: True
10021063 build-Depends:
@@ -1010,7 +1071,11 @@ executable AcidRain
10101071 default-language: Haskell2010
10111072 main-is: AcidRain.hs
10121073 hs-source-dirs: examples
1013− ghc-options: -Wall
1074+ ghc-options: -O2
1075+ -fspec-constr-recursive=10
1076+ -fmax-worker-args=16
1077+ -Wall
1078+ -with-rtsopts "-T"
10141079 if flag(examples) || flag(examples-sdl)
10151080 buildable: True
10161081 build-Depends:
@@ -1028,7 +1093,11 @@ executable CirclingSquare
10281093 default-language: Haskell2010
10291094 main-is: CirclingSquare.hs
10301095 hs-source-dirs: examples
1031− ghc-options: -Wall
1096+ ghc-options: -O2
1097+ -fspec-constr-recursive=10
1098+ -fmax-worker-args=16
1099+ -Wall
1100+ -with-rtsopts "-T"
10321101 if flag(examples-sdl)
10331102 buildable: True
10341103 build-Depends:
@@ -1061,7 +1130,11 @@ executable HandleIO
10611130 default-language: Haskell2010
10621131 main-is: HandleIO.hs
10631132 hs-source-dirs: examples
1064− ghc-options: -Wall
1133+ ghc-options: -O2
1134+ -fspec-constr-recursive=10
1135+ -fmax-worker-args=16
1136+ -Wall
1137+ -with-rtsopts "-T"
10651138 if flag(examples) || flag(examples-sdl)
10661139 buildable: True
10671140 build-Depends:
@@ -1074,7 +1147,11 @@ executable FileIOExamples
10741147 default-language: Haskell2010
10751148 main-is: FileIOExamples.hs
10761149 hs-source-dirs: examples
1077− ghc-options: -Wall
1150+ ghc-options: -O2
1151+ -fspec-constr-recursive=10
1152+ -fmax-worker-args=16
1153+ -Wall
1154+ -with-rtsopts "-T"
10781155 if flag(examples) || flag(examples-sdl)
10791156 buildable: False
10801157 build-Depends:
@@ -1087,7 +1164,11 @@ executable EchoServer
10871164 default-language: Haskell2010
10881165 main-is: EchoServer.hs
10891166 hs-source-dirs: examples
1090− ghc-options: -Wall
1167+ ghc-options: -O2
1168+ -fspec-constr-recursive=10
1169+ -fmax-worker-args=16
1170+ -Wall
1171+ -with-rtsopts "-T"
10911172 if (flag(examples) || flag(examples-sdl)) && !impl(ghcjs)
10921173 buildable: True
10931174 build-Depends:
@@ -1100,7 +1181,11 @@ executable FileSinkServer
11001181 default-language: Haskell2010
11011182 main-is: FileSinkServer.hs
11021183 hs-source-dirs: examples
1103− ghc-options: -Wall
1184+ ghc-options: -O2
1185+ -fspec-constr-recursive=10
1186+ -fmax-worker-args=16
1187+ -Wall
1188+ -with-rtsopts "-T"
11041189 if (flag(examples) || flag(examples-sdl)) && !impl(ghcjs)
11051190 buildable: True
11061191 build-Depends:
@@ -1113,7 +1198,11 @@ executable FromFileClient
11131198 default-language: Haskell2010
11141199 main-is: FromFileClient.hs
11151200 hs-source-dirs: examples
1116− ghc-options: -Wall
1201+ ghc-options: -O2
1202+ -fspec-constr-recursive=10
1203+ -fmax-worker-args=16
1204+ -Wall
1205+ -with-rtsopts "-T"
11171206 if (flag(examples) || flag(examples-sdl)) && !impl(ghcjs)
11181207 buildable: True
11191208 build-Depends: