@@ -69,10 +69,23 @@ flag use-prelude
6969-------------------------------------------------------------------------------
7070
7171common default-extensions
72+ default-language : Haskell2010
73+
74+ -- GHC2024 may include more extensions than we are actually using, see the
75+ -- full list below. We enable this to ensure that we are able to compile
76+ -- with this i.e. there is no interference by other extensions.
77+ if impl(ghc >= 9.10 )
78+ default-language : GHC2024
79+
80+ if impl(ghc >= 9.2 ) && impl(ghc < 9.10 )
81+ default-language : GHC2021
82+
83+ if impl(ghc >= 8.10 )
84+ default-extensions : StandaloneKindSignatures
85+
86+ -- In GHC 2024
7287 default-extensions :
7388 BangPatterns
74- CApiFFI
75- CPP
7689 ConstraintKinds
7790 DeriveDataTypeable
7891 DeriveGeneric
@@ -84,29 +97,33 @@ common default-extensions
8497 InstanceSigs
8598 KindSignatures
8699 LambdaCase
87- MagicHash
88100 MultiParamTypeClasses
89- PatternSynonyms
90101 RankNTypes
91- RecordWildCards
92102 ScopedTypeVariables
93103 TupleSections
94104 TypeApplications
95- TypeFamilies
96105 TypeOperators
97- ViewPatterns
98106
99- -- MonoLocalBinds, enabled by TypeFamilies, causes performance
100- -- regressions. Disable it. This must come after TypeFamilies,
101- -- otherwise TypeFamilies will enable it again.
102- NoMonoLocalBinds
107+ -- Not in GHC2024
108+ CApiFFI
109+ CPP
110+ MagicHash
111+ RecordWildCards
112+ -- MonoLocalBinds, enabled by TypeFamilies and GHC2024, was
113+ -- once found to cause runtime performance regressions which
114+ -- does not seem to be the case anymore, but need more testing
115+ -- to confirm. It is confirmed that it requires more memory
116+ -- for compilation at least in some cases (Data.Fold.Window
117+ -- benchmark on GHC-9.10.1 macOS). Disabling this must come
118+ -- after TypeFamilies, otherwise TypeFamilies will enable it
119+ -- again.
120+ -- NoMonoLocalBinds
103121
104122 -- UndecidableInstances -- Does not show any perf impact
105123 -- UnboxedTuples -- interferes with (#.)
106124
107125common compile-options
108126 import : default-extensions
109- default-language : Haskell2010
110127
111128 if flag(use-streamly-core)
112129 cpp-options : -DUSE_STREAMLY_CORE
@@ -229,7 +246,7 @@ library
229246common bench-options
230247 import : compile-options, optimization-options, bench-depends
231248 include-dirs : .
232- ghc-options : -rtsopts
249+ ghc-options : -rtsopts -with-rtsopts "-t"
233250 if flag(limit-build-mem)
234251 ghc-options : +RTS -M512M -RTS
235252 build-depends : streamly-benchmarks == 0.0.0
@@ -239,7 +256,7 @@ common bench-options-threaded
239256 import : compile-options, optimization-options, bench-depends
240257 -- -threaded and -N2 is important because some GC and space leak issues
241258 -- trigger only with these options.
242- ghc-options : -threaded -rtsopts -with-rtsopts "-N2"
259+ ghc-options : -threaded -rtsopts -with-rtsopts "-t - N2"
243260 if flag(limit-build-mem)
244261 ghc-options : +RTS -M512M -RTS
245262 build-depends : streamly-benchmarks == 0.0.0
@@ -313,6 +330,10 @@ benchmark Data.Fold.Window
313330 type : exitcode-stdio-1.0
314331 hs-source-dirs : Streamly/Benchmark/Data/Fold
315332 main-is : Window.hs
333+ -- MonoLocalBinds increases the memory requirement from 400MB to 1000MB,
334+ -- observed on macOS.
335+ if flag(limit-build-mem)
336+ ghc-options : +RTS -M1000M -RTS
316337
317338benchmark Data.MutArray
318339 import : bench-options
0 commit comments