@@ -59,6 +59,11 @@ flag use-gauge
5959 manual: True
6060 default: False
6161
62+flag bench-core
63+ description: Benchmark only core package
64+ manual: True
65+ default: False
66+
6267-------------------------------------------------------------------------------
6368-- Common stanzas
6469-------------------------------------------------------------------------------
@@ -120,8 +125,6 @@ common bench-depends
120125 , mtl >= 2.2 && < 2.3
121126
122127 -- other libraries
123− , streamly
124− , streamly-core
125128 , random >= 1.0 && < 2.0
126129 , transformers >= 0.4 && < 0.7
127130 , containers >= 0.5 && < 0.7
@@ -132,6 +135,12 @@ common bench-depends
132135 , filepath >= 1.4.1 && < 1.5
133136 , ghc-prim >= 0.4 && < 0.9
134137
138+ if flag(bench-core)
139+ build-depends: streamly-core
140+ else
141+ build-depends: streamly
142+ , streamly-core
143+
135144 if flag(use-gauge)
136145 build-depends: gauge >= 0.2.4 && < 0.3
137146 else
@@ -162,8 +171,12 @@ library
162171 import: lib-options, bench-depends
163172 hs-source-dirs: lib
164173 exposed-modules: Streamly.Benchmark.Common
165− , Streamly.Benchmark.Common.Handle
166− , Streamly.Benchmark.Prelude
174+ , Streamly.Benchmark.Common.Handle
175+ if flag(bench-core)
176+ exposed-modules:
177+ else
178+ exposed-modules: Streamly.Benchmark.Prelude
179+
167180
168181-------------------------------------------------------------------------------
169182-- Benchmarks
@@ -205,15 +218,15 @@ benchmark Prelude.Serial
205218 , Serial.Split
206219 , Serial.Exceptions
207220 , Serial.Lift
208− if impl(ghcjs)
221+ if flag(bench-core) || impl(ghcjs)
209222 buildable: False
210223 else
211224 buildable: True
212225 if flag(limit-build-mem)
213226 if flag(dev)
214− ghc-options: +RTS -M3500M -RTS
227+ ghc-options: +RTS -M3500M -RTS
215228 else
216− ghc-options: +RTS -M2000M -RTS
229+ ghc-options: +RTS -M2000M -RTS
217230
218231
219232benchmark Prelude.WSerial
@@ -221,7 +234,7 @@ benchmark Prelude.WSerial
221234 type: exitcode-stdio-1.0
222235 hs-source-dirs: Streamly/Benchmark/Prelude
223236 main-is: WSerial.hs
224− if impl(ghcjs)
237+ if flag(bench-core) || impl(ghcjs)
225238 buildable: False
226239 else
227240 buildable: True
@@ -233,7 +246,7 @@ benchmark Prelude.Merge
233246 type: exitcode-stdio-1.0
234247 hs-source-dirs: Streamly/Benchmark/Prelude
235248 main-is: Merge.hs
236− if impl(ghcjs)
249+ if flag(bench-core) || impl(ghcjs)
237250 buildable: False
238251 else
239252 buildable: True
@@ -243,7 +256,7 @@ benchmark Prelude.ZipSerial
243256 type: exitcode-stdio-1.0
244257 hs-source-dirs: Streamly/Benchmark/Prelude
245258 main-is: ZipSerial.hs
246− if impl(ghcjs)
259+ if flag(bench-core) || impl(ghcjs)
247260 buildable: False
248261 else
249262 buildable: True
@@ -253,20 +266,19 @@ benchmark Prelude.ZipAsync
253266 type: exitcode-stdio-1.0
254267 hs-source-dirs: Streamly/Benchmark/Prelude
255268 main-is: ZipAsync.hs
256− if impl(ghcjs)
269+ if flag(bench-core) || impl(ghcjs)
257270 buildable: False
258271 else
259272 buildable: True
260273 if flag(limit-build-mem)
261274 ghc-options: +RTS -M1000M -RTS
262275
263−
264276benchmark Prelude.Ahead
265277 import: bench-options-threaded
266278 type: exitcode-stdio-1.0
267279 hs-source-dirs: Streamly/Benchmark/Prelude
268280 main-is: Ahead.hs
269− if impl(ghcjs)
281+ if flag(bench-core) || impl(ghcjs)
270282 buildable: False
271283 else
272284 buildable: True
@@ -276,7 +288,7 @@ benchmark Prelude.Async
276288 type: exitcode-stdio-1.0
277289 hs-source-dirs: Streamly/Benchmark/Prelude
278290 main-is: Async.hs
279− if impl(ghcjs)
291+ if flag(bench-core) || impl(ghcjs)
280292 buildable: False
281293 else
282294 buildable: True
@@ -286,7 +298,7 @@ benchmark Prelude.WAsync
286298 type: exitcode-stdio-1.0
287299 hs-source-dirs: Streamly/Benchmark/Prelude
288300 main-is: WAsync.hs
289− if impl(ghcjs)
301+ if flag(bench-core) || impl(ghcjs)
290302 buildable: False
291303 else
292304 buildable: True
@@ -296,7 +308,7 @@ benchmark Prelude.Parallel
296308 type: exitcode-stdio-1.0
297309 hs-source-dirs: Streamly/Benchmark/Prelude
298310 main-is: Parallel.hs
299− if impl(ghcjs)
311+ if flag(bench-core) || impl(ghcjs)
300312 buildable: False
301313 else
302314 buildable: True
@@ -309,7 +321,7 @@ benchmark Data.Unfold
309321 type: exitcode-stdio-1.0
310322 hs-source-dirs: .
311323 main-is: Streamly/Benchmark/Data/Unfold.hs
312− if impl(ghcjs)
324+ if flag(bench-core) || impl(ghcjs)
313325 buildable: False
314326 else
315327 buildable: True
@@ -319,7 +331,7 @@ benchmark Data.Fold
319331 type: exitcode-stdio-1.0
320332 hs-source-dirs: Streamly/Benchmark/Data
321333 main-is: Fold.hs
322− if impl(ghcjs)
334+ if flag(bench-core) || impl(ghcjs)
323335 buildable: False
324336 else
325337 buildable: True
@@ -329,13 +341,17 @@ benchmark Data.Fold.Window
329341 type: exitcode-stdio-1.0
330342 hs-source-dirs: Streamly/Benchmark/Data/Fold
331343 main-is: Window.hs
344+ if flag(bench-core)
345+ buildable: False
346+ else
347+ buildable: True
332348
333349benchmark Data.Parser.ParserD
334350 import: bench-options
335351 type: exitcode-stdio-1.0
336352 hs-source-dirs: Streamly/Benchmark/Data/Parser
337353 main-is: ParserD.hs
338− if impl(ghcjs)
354+ if flag(bench-core) || impl(ghcjs)
339355 buildable: False
340356 else
341357 buildable: True
@@ -351,7 +367,7 @@ benchmark Data.Parser.ParserK
351367 type: exitcode-stdio-1.0
352368 hs-source-dirs: Streamly/Benchmark/Data/Parser
353369 main-is: ParserK.hs
354− if impl(ghcjs)
370+ if flag(bench-core) || impl(ghcjs)
355371 buildable: False
356372 else
357373 buildable: True
@@ -367,7 +383,7 @@ benchmark Data.Parser.FromParserK
367383 hs-source-dirs: Streamly/Benchmark/Data/Parser
368384 cpp-options: -DFROM_PARSERK
369385 main-is: ParserK.hs
370− if impl(ghcjs)
386+ if flag(bench-core) || impl(ghcjs)
371387 buildable: False
372388 else
373389 buildable: True
@@ -378,7 +394,7 @@ benchmark Data.Parser
378394 type: exitcode-stdio-1.0
379395 hs-source-dirs: Streamly/Benchmark/Data
380396 main-is: Parser.hs
381− if impl(ghcjs)
397+ if flag(bench-core) || impl(ghcjs)
382398 buildable: False
383399 else
384400 buildable: True
@@ -441,13 +457,17 @@ benchmark Prelude.Concurrent
441457 type: exitcode-stdio-1.0
442458 hs-source-dirs: Streamly/Benchmark/Prelude
443459 main-is: Concurrent.hs
460+ if flag(bench-core)
461+ buildable: False
462+ else
463+ buildable: True
444464
445465benchmark Prelude.Adaptive
446466 import: bench-options-threaded
447467 type: exitcode-stdio-1.0
448468 hs-source-dirs: Streamly/Benchmark/Prelude
449469 main-is: Adaptive.hs
450− if impl(ghcjs)
470+ if flag(bench-core) || impl(ghcjs)
451471 buildable: False
452472 else
453473 buildable: True
@@ -457,7 +477,7 @@ benchmark Prelude.Rate
457477 type: exitcode-stdio-1.0
458478 hs-source-dirs: Streamly/Benchmark/Prelude
459479 main-is: Rate.hs
460− if impl(ghcjs)
480+ if flag(bench-core) || impl(ghcjs)
461481 buildable: False
462482 else
463483 buildable: True
@@ -471,27 +491,47 @@ benchmark Data.Array
471491 type: exitcode-stdio-1.0
472492 hs-source-dirs: .
473493 main-is: Streamly/Benchmark/Data/Array.hs
494+ if flag(bench-core)
495+ buildable: False
496+ else
497+ buildable: True
474498
475499benchmark Data.Array.Prim
476500 import: bench-options
477501 type: exitcode-stdio-1.0
478502 main-is: Streamly/Benchmark/Data/Array/Prim.hs
479503 build-depends: primitive
504+ if flag(bench-core)
505+ buildable: False
506+ else
507+ buildable: True
480508
481509benchmark Data.SmallArray
482510 import: bench-options
483511 type: exitcode-stdio-1.0
484512 main-is: Streamly/Benchmark/Data/Array/SmallArray.hs
513+ if flag(bench-core)
514+ buildable: False
515+ else
516+ buildable: True
485517
486518benchmark Data.Array.Prim.Pinned
487519 import: bench-options
488520 type: exitcode-stdio-1.0
489521 main-is: Streamly/Benchmark/Data/Array/Prim/Pinned.hs
522+ if flag(bench-core)
523+ buildable: False
524+ else
525+ buildable: True
490526
491527benchmark Data.Array.Foreign
492528 import: bench-options
493529 type: exitcode-stdio-1.0
494530 main-is: Streamly/Benchmark/Data/Array/Foreign.hs
531+ if flag(bench-core)
532+ buildable: False
533+ else
534+ buildable: True
495535 if flag(limit-build-mem)
496536 ghc-options: +RTS -M1000M -RTS
497537
@@ -499,6 +539,10 @@ benchmark Data.Array.Foreign.Mut
499539 import: bench-options
500540 type: exitcode-stdio-1.0
501541 main-is: Streamly/Benchmark/Data/Array/Foreign/Mut.hs
542+ if flag(bench-core)
543+ buildable: False
544+ else
545+ buildable: True
502546
503547-------------------------------------------------------------------------------
504548-- Array Stream Benchmarks
@@ -509,7 +553,7 @@ benchmark Data.Array.Stream.Foreign
509553 type: exitcode-stdio-1.0
510554 hs-source-dirs: Streamly/Benchmark/Data/Array/Stream
511555 main-is: Foreign.hs
512− if impl(ghcjs)
556+ if flag(bench-core) || impl(ghcjs)
513557 buildable: False
514558 else
515559 buildable: True
@@ -527,6 +571,10 @@ benchmark FileSystem.Handle
527571 other-modules:
528572 Handle.Read
529573 , Handle.ReadWrite
574+ if flag(bench-core)
575+ buildable: False
576+ else
577+ buildable: True
530578
531579-------------------------------------------------------------------------------
532580-- Unicode Benchmarks
@@ -537,6 +585,10 @@ benchmark Unicode.Stream
537585 type: exitcode-stdio-1.0
538586 hs-source-dirs: Streamly/Benchmark/Unicode
539587 main-is: Stream.hs
588+ if flag(bench-core)
589+ buildable: False
590+ else
591+ buildable: True
540592
541593benchmark Unicode.Char
542594 import: bench-options
@@ -544,7 +596,7 @@ benchmark Unicode.Char
544596 hs-source-dirs: Streamly/Benchmark/Unicode
545597 main-is: Char.hs
546598 -- Takes too much memory for ghcjs
547− if impl(ghcjs)
599+ if flag(bench-core) || impl(ghcjs)
548600 buildable: False
549601
550602benchmark Unicode.Utf8
@@ -552,3 +604,7 @@ benchmark Unicode.Utf8
552604 type: exitcode-stdio-1.0
553605 hs-source-dirs: Streamly/Benchmark/Unicode
554606 main-is: Utf8.hs
607+ if flag(bench-core)
608+ buildable: False
609+ else
610+ buildable: True