on master help sign in
Add bench-core flag to build core only
280eac7Ranjeet Kumar Ranjan
benchmark/streamly-benchmarks.cabal+82−26
@@ -59,6 +59,11 @@ flag use-gauge
59 manual: True
59 manual: True
60 default: False
60 default: False
61
61
62+flag bench-core
63+ description: Benchmark only core package
64+ manual: True
65+ default: False
66+
62-------------------------------------------------------------------------------
67-------------------------------------------------------------------------------
63-- Common stanzas
68-- Common stanzas
64-------------------------------------------------------------------------------
69-------------------------------------------------------------------------------
@@ -120,8 +125,6 @@ common bench-depends
120 , mtl >= 2.2 && < 2.3
125 , mtl >= 2.2 && < 2.3
121
126
122 -- other libraries
127 -- other libraries
123− , streamly
124− , streamly-core
125 , random >= 1.0 && < 2.0
128 , random >= 1.0 && < 2.0
126 , transformers >= 0.4 && < 0.7
129 , transformers >= 0.4 && < 0.7
127 , containers >= 0.5 && < 0.7
130 , containers >= 0.5 && < 0.7
@@ -132,6 +135,12 @@ common bench-depends
132 , filepath >= 1.4.1 && < 1.5
135 , filepath >= 1.4.1 && < 1.5
133 , ghc-prim >= 0.4 && < 0.9
136 , ghc-prim >= 0.4 && < 0.9
134
137
138+ if flag(bench-core)
139+ build-depends: streamly-core
140+ else
141+ build-depends: streamly
142+ , streamly-core
143+
135 if flag(use-gauge)
144 if flag(use-gauge)
136 build-depends: gauge >= 0.2.4 && < 0.3
145 build-depends: gauge >= 0.2.4 && < 0.3
137 else
146 else
@@ -162,8 +171,12 @@ library
162 import: lib-options, bench-depends
171 import: lib-options, bench-depends
163 hs-source-dirs: lib
172 hs-source-dirs: lib
164 exposed-modules: Streamly.Benchmark.Common
173 exposed-modules: Streamly.Benchmark.Common
165− , Streamly.Benchmark.Common.Handle
174+ , Streamly.Benchmark.Common.Handle
175+ if flag(bench-core)
176+ exposed-modules:
177+ else
166− , Streamly.Benchmark.Prelude
178+ exposed-modules: Streamly.Benchmark.Prelude
179+
167
180
168-------------------------------------------------------------------------------
181-------------------------------------------------------------------------------
169-- Benchmarks
182-- Benchmarks
@@ -205,15 +218,15 @@ benchmark Prelude.Serial
205 , Serial.Split
218 , Serial.Split
206 , Serial.Exceptions
219 , Serial.Exceptions
207 , Serial.Lift
220 , Serial.Lift
208− if impl(ghcjs)
221+ if flag(bench-core) || impl(ghcjs)
209 buildable: False
222 buildable: False
210 else
223 else
211 buildable: True
224 buildable: True
212 if flag(limit-build-mem)
225 if flag(limit-build-mem)
213 if flag(dev)
226 if flag(dev)
214− ghc-options: +RTS -M3500M -RTS
227+ ghc-options: +RTS -M3500M -RTS
215 else
228 else
216− ghc-options: +RTS -M2000M -RTS
229+ ghc-options: +RTS -M2000M -RTS
217
230
218
231
219benchmark Prelude.WSerial
232benchmark Prelude.WSerial
@@ -221,7 +234,7 @@ benchmark Prelude.WSerial
221 type: exitcode-stdio-1.0
234 type: exitcode-stdio-1.0
222 hs-source-dirs: Streamly/Benchmark/Prelude
235 hs-source-dirs: Streamly/Benchmark/Prelude
223 main-is: WSerial.hs
236 main-is: WSerial.hs
224− if impl(ghcjs)
237+ if flag(bench-core) || impl(ghcjs)
225 buildable: False
238 buildable: False
226 else
239 else
227 buildable: True
240 buildable: True
@@ -233,7 +246,7 @@ benchmark Prelude.Merge
233 type: exitcode-stdio-1.0
246 type: exitcode-stdio-1.0
234 hs-source-dirs: Streamly/Benchmark/Prelude
247 hs-source-dirs: Streamly/Benchmark/Prelude
235 main-is: Merge.hs
248 main-is: Merge.hs
236− if impl(ghcjs)
249+ if flag(bench-core) || impl(ghcjs)
237 buildable: False
250 buildable: False
238 else
251 else
239 buildable: True
252 buildable: True
@@ -243,7 +256,7 @@ benchmark Prelude.ZipSerial
243 type: exitcode-stdio-1.0
256 type: exitcode-stdio-1.0
244 hs-source-dirs: Streamly/Benchmark/Prelude
257 hs-source-dirs: Streamly/Benchmark/Prelude
245 main-is: ZipSerial.hs
258 main-is: ZipSerial.hs
246− if impl(ghcjs)
259+ if flag(bench-core) || impl(ghcjs)
247 buildable: False
260 buildable: False
248 else
261 else
249 buildable: True
262 buildable: True
@@ -253,20 +266,19 @@ benchmark Prelude.ZipAsync
253 type: exitcode-stdio-1.0
266 type: exitcode-stdio-1.0
254 hs-source-dirs: Streamly/Benchmark/Prelude
267 hs-source-dirs: Streamly/Benchmark/Prelude
255 main-is: ZipAsync.hs
268 main-is: ZipAsync.hs
256− if impl(ghcjs)
269+ if flag(bench-core) || impl(ghcjs)
257 buildable: False
270 buildable: False
258 else
271 else
259 buildable: True
272 buildable: True
260 if flag(limit-build-mem)
273 if flag(limit-build-mem)
261 ghc-options: +RTS -M1000M -RTS
274 ghc-options: +RTS -M1000M -RTS
262
275
263−
264benchmark Prelude.Ahead
276benchmark Prelude.Ahead
265 import: bench-options-threaded
277 import: bench-options-threaded
266 type: exitcode-stdio-1.0
278 type: exitcode-stdio-1.0
267 hs-source-dirs: Streamly/Benchmark/Prelude
279 hs-source-dirs: Streamly/Benchmark/Prelude
268 main-is: Ahead.hs
280 main-is: Ahead.hs
269− if impl(ghcjs)
281+ if flag(bench-core) || impl(ghcjs)
270 buildable: False
282 buildable: False
271 else
283 else
272 buildable: True
284 buildable: True
@@ -276,7 +288,7 @@ benchmark Prelude.Async
276 type: exitcode-stdio-1.0
288 type: exitcode-stdio-1.0
277 hs-source-dirs: Streamly/Benchmark/Prelude
289 hs-source-dirs: Streamly/Benchmark/Prelude
278 main-is: Async.hs
290 main-is: Async.hs
279− if impl(ghcjs)
291+ if flag(bench-core) || impl(ghcjs)
280 buildable: False
292 buildable: False
281 else
293 else
282 buildable: True
294 buildable: True
@@ -286,7 +298,7 @@ benchmark Prelude.WAsync
286 type: exitcode-stdio-1.0
298 type: exitcode-stdio-1.0
287 hs-source-dirs: Streamly/Benchmark/Prelude
299 hs-source-dirs: Streamly/Benchmark/Prelude
288 main-is: WAsync.hs
300 main-is: WAsync.hs
289− if impl(ghcjs)
301+ if flag(bench-core) || impl(ghcjs)
290 buildable: False
302 buildable: False
291 else
303 else
292 buildable: True
304 buildable: True
@@ -296,7 +308,7 @@ benchmark Prelude.Parallel
296 type: exitcode-stdio-1.0
308 type: exitcode-stdio-1.0
297 hs-source-dirs: Streamly/Benchmark/Prelude
309 hs-source-dirs: Streamly/Benchmark/Prelude
298 main-is: Parallel.hs
310 main-is: Parallel.hs
299− if impl(ghcjs)
311+ if flag(bench-core) || impl(ghcjs)
300 buildable: False
312 buildable: False
301 else
313 else
302 buildable: True
314 buildable: True
@@ -309,7 +321,7 @@ benchmark Data.Unfold
309 type: exitcode-stdio-1.0
321 type: exitcode-stdio-1.0
310 hs-source-dirs: .
322 hs-source-dirs: .
311 main-is: Streamly/Benchmark/Data/Unfold.hs
323 main-is: Streamly/Benchmark/Data/Unfold.hs
312− if impl(ghcjs)
324+ if flag(bench-core) || impl(ghcjs)
313 buildable: False
325 buildable: False
314 else
326 else
315 buildable: True
327 buildable: True
@@ -319,7 +331,7 @@ benchmark Data.Fold
319 type: exitcode-stdio-1.0
331 type: exitcode-stdio-1.0
320 hs-source-dirs: Streamly/Benchmark/Data
332 hs-source-dirs: Streamly/Benchmark/Data
321 main-is: Fold.hs
333 main-is: Fold.hs
322− if impl(ghcjs)
334+ if flag(bench-core) || impl(ghcjs)
323 buildable: False
335 buildable: False
324 else
336 else
325 buildable: True
337 buildable: True
@@ -329,13 +341,17 @@ benchmark Data.Fold.Window
329 type: exitcode-stdio-1.0
341 type: exitcode-stdio-1.0
330 hs-source-dirs: Streamly/Benchmark/Data/Fold
342 hs-source-dirs: Streamly/Benchmark/Data/Fold
331 main-is: Window.hs
343 main-is: Window.hs
344+ if flag(bench-core)
345+ buildable: False
346+ else
347+ buildable: True
332
348
333benchmark Data.Parser.ParserD
349benchmark Data.Parser.ParserD
334 import: bench-options
350 import: bench-options
335 type: exitcode-stdio-1.0
351 type: exitcode-stdio-1.0
336 hs-source-dirs: Streamly/Benchmark/Data/Parser
352 hs-source-dirs: Streamly/Benchmark/Data/Parser
337 main-is: ParserD.hs
353 main-is: ParserD.hs
338− if impl(ghcjs)
354+ if flag(bench-core) || impl(ghcjs)
339 buildable: False
355 buildable: False
340 else
356 else
341 buildable: True
357 buildable: True
@@ -351,7 +367,7 @@ benchmark Data.Parser.ParserK
351 type: exitcode-stdio-1.0
367 type: exitcode-stdio-1.0
352 hs-source-dirs: Streamly/Benchmark/Data/Parser
368 hs-source-dirs: Streamly/Benchmark/Data/Parser
353 main-is: ParserK.hs
369 main-is: ParserK.hs
354− if impl(ghcjs)
370+ if flag(bench-core) || impl(ghcjs)
355 buildable: False
371 buildable: False
356 else
372 else
357 buildable: True
373 buildable: True
@@ -367,7 +383,7 @@ benchmark Data.Parser.FromParserK
367 hs-source-dirs: Streamly/Benchmark/Data/Parser
383 hs-source-dirs: Streamly/Benchmark/Data/Parser
368 cpp-options: -DFROM_PARSERK
384 cpp-options: -DFROM_PARSERK
369 main-is: ParserK.hs
385 main-is: ParserK.hs
370− if impl(ghcjs)
386+ if flag(bench-core) || impl(ghcjs)
371 buildable: False
387 buildable: False
372 else
388 else
373 buildable: True
389 buildable: True
@@ -378,7 +394,7 @@ benchmark Data.Parser
378 type: exitcode-stdio-1.0
394 type: exitcode-stdio-1.0
379 hs-source-dirs: Streamly/Benchmark/Data
395 hs-source-dirs: Streamly/Benchmark/Data
380 main-is: Parser.hs
396 main-is: Parser.hs
381− if impl(ghcjs)
397+ if flag(bench-core) || impl(ghcjs)
382 buildable: False
398 buildable: False
383 else
399 else
384 buildable: True
400 buildable: True
@@ -441,13 +457,17 @@ benchmark Prelude.Concurrent
441 type: exitcode-stdio-1.0
457 type: exitcode-stdio-1.0
442 hs-source-dirs: Streamly/Benchmark/Prelude
458 hs-source-dirs: Streamly/Benchmark/Prelude
443 main-is: Concurrent.hs
459 main-is: Concurrent.hs
460+ if flag(bench-core)
461+ buildable: False
462+ else
463+ buildable: True
444
464
445benchmark Prelude.Adaptive
465benchmark Prelude.Adaptive
446 import: bench-options-threaded
466 import: bench-options-threaded
447 type: exitcode-stdio-1.0
467 type: exitcode-stdio-1.0
448 hs-source-dirs: Streamly/Benchmark/Prelude
468 hs-source-dirs: Streamly/Benchmark/Prelude
449 main-is: Adaptive.hs
469 main-is: Adaptive.hs
450− if impl(ghcjs)
470+ if flag(bench-core) || impl(ghcjs)
451 buildable: False
471 buildable: False
452 else
472 else
453 buildable: True
473 buildable: True
@@ -457,7 +477,7 @@ benchmark Prelude.Rate
457 type: exitcode-stdio-1.0
477 type: exitcode-stdio-1.0
458 hs-source-dirs: Streamly/Benchmark/Prelude
478 hs-source-dirs: Streamly/Benchmark/Prelude
459 main-is: Rate.hs
479 main-is: Rate.hs
460− if impl(ghcjs)
480+ if flag(bench-core) || impl(ghcjs)
461 buildable: False
481 buildable: False
462 else
482 else
463 buildable: True
483 buildable: True
@@ -471,27 +491,47 @@ benchmark Data.Array
471 type: exitcode-stdio-1.0
491 type: exitcode-stdio-1.0
472 hs-source-dirs: .
492 hs-source-dirs: .
473 main-is: Streamly/Benchmark/Data/Array.hs
493 main-is: Streamly/Benchmark/Data/Array.hs
494+ if flag(bench-core)
495+ buildable: False
496+ else
497+ buildable: True
474
498
475benchmark Data.Array.Prim
499benchmark Data.Array.Prim
476 import: bench-options
500 import: bench-options
477 type: exitcode-stdio-1.0
501 type: exitcode-stdio-1.0
478 main-is: Streamly/Benchmark/Data/Array/Prim.hs
502 main-is: Streamly/Benchmark/Data/Array/Prim.hs
479 build-depends: primitive
503 build-depends: primitive
504+ if flag(bench-core)
505+ buildable: False
506+ else
507+ buildable: True
480
508
481benchmark Data.SmallArray
509benchmark Data.SmallArray
482 import: bench-options
510 import: bench-options
483 type: exitcode-stdio-1.0
511 type: exitcode-stdio-1.0
484 main-is: Streamly/Benchmark/Data/Array/SmallArray.hs
512 main-is: Streamly/Benchmark/Data/Array/SmallArray.hs
513+ if flag(bench-core)
514+ buildable: False
515+ else
516+ buildable: True
485
517
486benchmark Data.Array.Prim.Pinned
518benchmark Data.Array.Prim.Pinned
487 import: bench-options
519 import: bench-options
488 type: exitcode-stdio-1.0
520 type: exitcode-stdio-1.0
489 main-is: Streamly/Benchmark/Data/Array/Prim/Pinned.hs
521 main-is: Streamly/Benchmark/Data/Array/Prim/Pinned.hs
522+ if flag(bench-core)
523+ buildable: False
524+ else
525+ buildable: True
490
526
491benchmark Data.Array.Foreign
527benchmark Data.Array.Foreign
492 import: bench-options
528 import: bench-options
493 type: exitcode-stdio-1.0
529 type: exitcode-stdio-1.0
494 main-is: Streamly/Benchmark/Data/Array/Foreign.hs
530 main-is: Streamly/Benchmark/Data/Array/Foreign.hs
531+ if flag(bench-core)
532+ buildable: False
533+ else
534+ buildable: True
495 if flag(limit-build-mem)
535 if flag(limit-build-mem)
496 ghc-options: +RTS -M1000M -RTS
536 ghc-options: +RTS -M1000M -RTS
497
537
@@ -499,6 +539,10 @@ benchmark Data.Array.Foreign.Mut
499 import: bench-options
539 import: bench-options
500 type: exitcode-stdio-1.0
540 type: exitcode-stdio-1.0
501 main-is: Streamly/Benchmark/Data/Array/Foreign/Mut.hs
541 main-is: Streamly/Benchmark/Data/Array/Foreign/Mut.hs
542+ if flag(bench-core)
543+ buildable: False
544+ else
545+ buildable: True
502
546
503-------------------------------------------------------------------------------
547-------------------------------------------------------------------------------
504-- Array Stream Benchmarks
548-- Array Stream Benchmarks
@@ -509,7 +553,7 @@ benchmark Data.Array.Stream.Foreign
509 type: exitcode-stdio-1.0
553 type: exitcode-stdio-1.0
510 hs-source-dirs: Streamly/Benchmark/Data/Array/Stream
554 hs-source-dirs: Streamly/Benchmark/Data/Array/Stream
511 main-is: Foreign.hs
555 main-is: Foreign.hs
512− if impl(ghcjs)
556+ if flag(bench-core) || impl(ghcjs)
513 buildable: False
557 buildable: False
514 else
558 else
515 buildable: True
559 buildable: True
@@ -527,6 +571,10 @@ benchmark FileSystem.Handle
527 other-modules:
571 other-modules:
528 Handle.Read
572 Handle.Read
529 , Handle.ReadWrite
573 , Handle.ReadWrite
574+ if flag(bench-core)
575+ buildable: False
576+ else
577+ buildable: True
530
578
531-------------------------------------------------------------------------------
579-------------------------------------------------------------------------------
532-- Unicode Benchmarks
580-- Unicode Benchmarks
@@ -537,6 +585,10 @@ benchmark Unicode.Stream
537 type: exitcode-stdio-1.0
585 type: exitcode-stdio-1.0
538 hs-source-dirs: Streamly/Benchmark/Unicode
586 hs-source-dirs: Streamly/Benchmark/Unicode
539 main-is: Stream.hs
587 main-is: Stream.hs
588+ if flag(bench-core)
589+ buildable: False
590+ else
591+ buildable: True
540
592
541benchmark Unicode.Char
593benchmark Unicode.Char
542 import: bench-options
594 import: bench-options
@@ -544,7 +596,7 @@ benchmark Unicode.Char
544 hs-source-dirs: Streamly/Benchmark/Unicode
596 hs-source-dirs: Streamly/Benchmark/Unicode
545 main-is: Char.hs
597 main-is: Char.hs
546 -- Takes too much memory for ghcjs
598 -- Takes too much memory for ghcjs
547− if impl(ghcjs)
599+ if flag(bench-core) || impl(ghcjs)
548 buildable: False
600 buildable: False
549
601
550benchmark Unicode.Utf8
602benchmark Unicode.Utf8
@@ -552,3 +604,7 @@ benchmark Unicode.Utf8
552 type: exitcode-stdio-1.0
604 type: exitcode-stdio-1.0
553 hs-source-dirs: Streamly/Benchmark/Unicode
605 hs-source-dirs: Streamly/Benchmark/Unicode
554 main-is: Utf8.hs
606 main-is: Utf8.hs
607+ if flag(bench-core)
608+ buildable: False
609+ else
610+ buildable: True