on master help sign in
Move compilation memory restrictions under a flag
commit27ccdf4d94df8c62d5aef5ded723e8078d099706 authorAdithya Kumar <adithya@composewell.com> dateTue 23 Mar 2021, 00:52 (6 years ago) parent42b0ab9
2 files changed+39−12
benchmark/streamly-benchmarks.cabal+19−5 test/streamly-tests.cabal+20−7
benchmark/streamly-benchmarks.cabal+19−5
@@ -19,6 +19,11 @@ flag fusion-plugin
1919 manual: True
2020 default: False
2121
22+flag limit-build-mem
23+ description: Limits memory when building the executables
24+ manual: True
25+ default: False
26+
2227flag inspection
2328 description: Enable inspection testing
2429 manual: True
@@ -173,11 +178,13 @@ benchmark Prelude.Serial
173178 , Serial.Nested
174179 , Serial.Exceptions
175180 , Serial.Split
176− ghc-options: +RTS -M2000M -RTS
177181 if impl(ghcjs)
178182 buildable: False
179183 else
180184 buildable: True
185+ if flag(limit-build-mem)
186+ ghc-options: +RTS -M2000M -RTS
187+
181188
182189benchmark Prelude.WSerial
183190 import: bench-options
@@ -202,13 +209,15 @@ benchmark Prelude.ZipSerial
202209benchmark Prelude.ZipAsync
203210 import: bench-options
204211 type: exitcode-stdio-1.0
205− ghc-options: +RTS -M1000M -RTS
206212 hs-source-dirs: Streamly/Benchmark/Prelude
207213 main-is: ZipAsync.hs
208214 if impl(ghcjs)
209215 buildable: False
210216 else
211217 buildable: True
218+ if flag(limit-build-mem)
219+ ghc-options: +RTS -M1000M -RTS
220+
212221
213222benchmark Prelude.Ahead
214223 import: bench-options-threaded
@@ -243,13 +252,15 @@ benchmark Prelude.WAsync
243252benchmark Prelude.Parallel
244253 import: bench-options-threaded
245254 type: exitcode-stdio-1.0
246− ghc-options: +RTS -M2000M -RTS
247255 hs-source-dirs: Streamly/Benchmark/Prelude
248256 main-is: Parallel.hs
249257 if impl(ghcjs)
250258 buildable: False
251259 else
252260 buildable: True
261+ if flag(limit-build-mem)
262+ ghc-options: +RTS -M2000M -RTS
263+
253264
254265benchmark Data.Unfold
255266 import: bench-options
@@ -276,12 +287,14 @@ benchmark Data.Parser.ParserD
276287 type: exitcode-stdio-1.0
277288 hs-source-dirs: Streamly/Benchmark/Data/Parser
278289 main-is: ParserD.hs
279− ghc-options: +RTS -M750M -RTS
280290 if impl(ghcjs)
281291 buildable: False
282292 else
283293 buildable: True
284294 build-depends: exceptions >= 0.8 && < 0.11
295+ if flag(limit-build-mem)
296+ ghc-options: +RTS -M750M -RTS
297+
285298
286299benchmark Data.Parser.ParserK
287300 import: bench-options
@@ -314,13 +327,14 @@ benchmark Data.Parser
314327 import: bench-options
315328 type: exitcode-stdio-1.0
316329 hs-source-dirs: Streamly/Benchmark/Data
317− ghc-options: +RTS -M1000M -RTS
318330 main-is: Parser.hs
319331 if impl(ghcjs)
320332 buildable: False
321333 else
322334 buildable: True
323335 build-depends: exceptions >= 0.8 && < 0.11
336+ if flag(limit-build-mem)
337+ ghc-options: +RTS -M1000M -RTS
324338
325339-------------------------------------------------------------------------------
326340-- Raw Streams
test/streamly-tests.cabal+20−7
@@ -10,6 +10,11 @@ flag fusion-plugin
1010 manual: True
1111 default: False
1212
13+flag limit-build-mem
14+ description: Limits memory when building the executables
15+ manual: True
16+ default: False
17+
1318flag dev
1419 description: Development build
1520 manual: True
@@ -53,6 +58,7 @@ common compile-options
5358 -Wredundant-constraints
5459 -Wnoncanonical-monad-instances
5560 -Rghc-timing
61+ -fno-ignore-asserts
5662
5763 if flag(has-llvm)
5864 ghc-options: -fllvm
@@ -61,8 +67,8 @@ common compile-options
6167 ghc-options: -Wmissed-specialisations
6268 -Wall-missed-specialisations
6369
64− ghc-options: -fno-ignore-asserts
65− +RTS -M512M -RTS
70+ if flag(limit-build-mem)
71+ ghc-options: +RTS -M512M -RTS
6672
6773common default-extensions
6874 default-extensions:
@@ -146,10 +152,12 @@ common lib-options
146152
147153library
148154 import: lib-options, test-dependencies
149− ghc-options: +RTS -M1500M -RTS
150155 hs-source-dirs: lib
151156 exposed-modules: Streamly.Test.Common
152157 , Streamly.Test.Prelude.Common
158+ if flag(limit-build-mem)
159+ ghc-options: +RTS -M1500M -RTS
160+
153161
154162-------------------------------------------------------------------------------
155163-- Test suite options
@@ -222,13 +230,15 @@ test-suite Data.Parser
222230 import: test-options
223231 type: exitcode-stdio-1.0
224232 main-is: Streamly/Test/Data/Parser.hs
225− ghc-options: +RTS -M1000M -RTS
233+ if flag(limit-build-mem)
234+ ghc-options: +RTS -M1000M -RTS
226235
227236test-suite Data.Parser.ParserD
228237 import: test-options
229238 type: exitcode-stdio-1.0
230239 main-is: Streamly/Test/Data/Parser/ParserD.hs
231− ghc-options: +RTS -M1000M -RTS
240+ if flag(limit-build-mem)
241+ ghc-options: +RTS -M1000M -RTS
232242
233243test-suite Data.SmallArray
234244 import: test-options
@@ -287,7 +297,8 @@ test-suite Prelude.Concurrent
287297 type: exitcode-stdio-1.0
288298 main-is: Streamly/Test/Prelude/Concurrent.hs
289299 ghc-options: -main-is Streamly.Test.Prelude.Concurrent.main
290− +RTS -M2000M -RTS
300+ if flag(limit-build-mem)
301+ ghc-options: +RTS -M2000M -RTS
291302
292303test-suite Prelude.Fold
293304 import: test-options
@@ -316,7 +327,9 @@ test-suite Prelude.Serial
316327 type: exitcode-stdio-1.0
317328 main-is: Streamly/Test/Prelude/Serial.hs
318329 ghc-options: -main-is Streamly.Test.Prelude.Serial.main
319− +RTS -M1500M -RTS
330+ if flag(limit-build-mem)
331+ ghc-options: +RTS -M1500M -RTS
332+
320333
321334test-suite Prelude.WAsync
322335 import: test-options