@@ -95,55 +95,6 @@ common optimization-options
9595common lib-options
9696 import: compile-options, optimization-options
9797
98−-------------------------------------------------------------------------------
99−-- Library
100−-------------------------------------------------------------------------------
101−
102−library
103− import: lib-options
104− hs-source-dirs: .
105− exposed-modules:
106− Common
107−
108− build-depends:
109− -- Core libraries shipped with ghc, the min and max
110− -- constraints of these libraries should match with
111− -- the GHC versions we support
112− base >= 4.8 && < 5
113− , deepseq >= 1.4.1 && < 1.5
114−
115− -- other libraries
116− , streamly >= 0.7.0
117− , gauge >= 0.2.4 && < 0.3
118− , random >= 1.0 && < 2.0
119−
120−library lib-prelude
121− import: lib-options
122− hs-source-dirs: .
123− exposed-modules:
124− Streamly.Benchmark.Prelude
125− build-depends:
126− -- Core libraries shipped with ghc, the min and max
127− -- constraints of these libraries should match with
128− -- the GHC versions we support
129− base >= 4.8 && < 5
130− , deepseq >= 1.4.1 && < 1.5
131− , mtl >= 2.2 && < 3
132−
133− -- other libraries
134− , streamly >= 0.7.0
135− if flag(inspection)
136− build-depends: template-haskell >= 2.14 && < 2.16
137− , inspection-testing >= 0.4 && < 0.5
138− -- Array uses a Storable constraint in dev build making several inspection
139− -- tests fail
140− if flag(dev) && flag(inspection)
141− build-depends: inspection-and-dev-flags-cannot-be-used-together
142−
143−-------------------------------------------------------------------------------
144−-- Benchmarks
145−-------------------------------------------------------------------------------
146−
14798common bench-depends
14899 build-depends:
149100 -- Core libraries shipped with ghc, the min and max
@@ -154,7 +105,6 @@ common bench-depends
154105 , mtl >= 2.2 && < 3
155106
156107 -- other libraries
157− , streamly-benchmarks
158108 , streamly >= 0.7.0
159109 , random >= 1.0 && < 2.0
160110 , gauge >= 0.2.4 && < 0.3
@@ -167,6 +117,25 @@ common bench-depends
167117 if flag(inspection)
168118 build-depends: template-haskell >= 2.14 && < 2.16
169119 , inspection-testing >= 0.4 && < 0.5
120+ -- Array uses a Storable constraint in dev build making several inspection
121+ -- tests fail
122+ if flag(dev) && flag(inspection)
123+ build-depends: inspection-and-dev-flags-cannot-be-used-together
124+
125+-------------------------------------------------------------------------------
126+-- Library
127+-------------------------------------------------------------------------------
128+
129+library
130+ import: lib-options, bench-depends
131+ hs-source-dirs: lib
132+ exposed-modules:
133+ Streamly.Benchmark.Common
134+ , Streamly.Benchmark.Prelude
135+
136+-------------------------------------------------------------------------------
137+-- Benchmarks
138+-------------------------------------------------------------------------------
170139
171140-- Whatever stack size below 32K we use GHC seems to report the stack size as
172141-- 32K at crash. Even K0K works. Therefore it probably does not make sense to
@@ -175,6 +144,8 @@ common bench-depends
175144common bench-options
176145 import: compile-options, optimization-options, bench-depends
177146 ghc-options: -with-rtsopts "-T -K32K -M16M"
147+ build-depends: streamly-benchmarks
148+ hs-source-dirs: .
178149
179150-- Some benchmarks are threaded some are not
180151common bench-options-threaded
@@ -182,6 +153,8 @@ common bench-options-threaded
182153 -- -threaded and -N2 is important because some GC and space leak issues
183154 -- trigger only with these options.
184155 ghc-options: -threaded -with-rtsopts "-T -N2 -K32K -M16M"
156+ build-depends: streamly-benchmarks
157+ hs-source-dirs: .
185158
186159-------------------------------------------------------------------------------
187160-- Serial Streams
@@ -192,50 +165,36 @@ benchmark linear
192165 import: bench-options
193166 type: exitcode-stdio-1.0
194167 ghc-options: -with-rtsopts "-T -K36K -M16M"
195− hs-source-dirs: exe
196− main-is: Prelude/Serial/O_1_Space.hs
197− build-depends:
198− lib-prelude
168+ main-is: Streamly/Benchmark/Prelude/Serial/O_1_Space.hs
199169
200170benchmark serial-O-n-heap
201171 import: bench-options
202172 type: exitcode-stdio-1.0
203173 ghc-options: -with-rtsopts "-T -K36K -M128M"
204− hs-source-dirs: exe
205− main-is: Prelude/Serial/O_n_Heap.hs
206− build-depends:
207− lib-prelude
174+ main-is: Streamly/Benchmark/Prelude/Serial/O_n_Heap.hs
208175
209176benchmark serial-O-n-stack
210177 import: bench-options
211178 type: exitcode-stdio-1.0
212179 ghc-options: -with-rtsopts "-T -K1M -M16M"
213− hs-source-dirs: exe
214− main-is: Prelude/Serial/O_n_Stack.hs
215− build-depends:
216− lib-prelude
180+ main-is: Streamly/Benchmark/Prelude/Serial/O_n_Stack.hs
217181
218182benchmark serial-O-n-space
219183 import: bench-options
220184 type: exitcode-stdio-1.0
221185 ghc-options: -with-rtsopts "-T -K16M -M64M"
222− hs-source-dirs: exe
223− main-is: Prelude/Serial/O_n_Space.hs
224− build-depends:
225− lib-prelude
186+ main-is: Streamly/Benchmark/Prelude/Serial/O_n_Space.hs
226187
227188benchmark nested
228189 import: bench-options
229190 type: exitcode-stdio-1.0
230191 ghc-options: -with-rtsopts "-T -K256K -M16M"
231− hs-source-dirs: .
232192 main-is: Nested.hs
233193 other-modules: NestedOps
234194
235195benchmark nested-unfold
236196 import: bench-options
237197 type: exitcode-stdio-1.0
238− hs-source-dirs: .
239198 ghc-options: -with-rtsopts "-T -K64K -M16M"
240199 main-is: NestedUnfold.hs
241200 other-modules: NestedUnfoldOps
@@ -243,7 +202,6 @@ benchmark nested-unfold
243202benchmark base
244203 import: bench-options
245204 type: exitcode-stdio-1.0
246− hs-source-dirs: .
247205 if flag(dev)
248206 cpp-options: -DDEVBUILD
249207 ghc-options: -with-rtsopts "-T -K2M -M16M"
@@ -256,7 +214,6 @@ benchmark base
256214
257215executable nano-bench
258216 import: bench-options
259− hs-source-dirs: .
260217 main-is: NanoBenchmarks.hs
261218 if flag(dev)
262219 buildable: True
@@ -270,16 +227,12 @@ executable nano-bench
270227benchmark linear-async
271228 import: bench-options-threaded
272229 type: exitcode-stdio-1.0
273− hs-source-dirs: .
274230 ghc-options: -with-rtsopts "-T -N2 -K64K -M16M"
275231 main-is: LinearAsync.hs
276− build-depends:
277− lib-prelude
278232
279233benchmark nested-concurrent
280234 import: bench-options-threaded
281235 type: exitcode-stdio-1.0
282− hs-source-dirs: .
283236 -- XXX this can be lowered once we split out the finite benchmarks
284237 ghc-options: -with-rtsopts "-T -N2 -K256K -M128M"
285238 main-is: NestedConcurrent.hs
@@ -288,39 +241,25 @@ benchmark nested-concurrent
288241benchmark parallel
289242 import: bench-options-threaded
290243 type: exitcode-stdio-1.0
291− hs-source-dirs: .
292244 ghc-options: -with-rtsopts "-T -N2 -K128K -M256M"
293245 main-is: Parallel.hs
294246 other-modules: NestedOps
295− build-depends:
296− lib-prelude
297247
298248benchmark concurrent
299249 import: bench-options-threaded
300250 type: exitcode-stdio-1.0
301− hs-source-dirs: .
302251 main-is: Concurrent.hs
303252 ghc-options: -with-rtsopts "-T -N2 -K256K -M384M"
304253
305254benchmark adaptive
306255 import: bench-options-threaded
307256 type: exitcode-stdio-1.0
308− hs-source-dirs: .
309257 main-is: Adaptive.hs
310− default-language: Haskell2010
311− build-depends:
312− streamly
313− , base >= 4.8 && < 5
314− , gauge >= 0.2.4 && < 0.3
315− , random >= 1.0 && < 2.0
316258
317259benchmark linear-rate
318260 import: bench-options-threaded
319261 type: exitcode-stdio-1.0
320− hs-source-dirs: .
321262 main-is: LinearRate.hs
322− build-depends:
323− lib-prelude
324263
325264-------------------------------------------------------------------------------
326265-- Array Benchmarks
@@ -329,7 +268,6 @@ benchmark linear-rate
329268benchmark unpinned-array
330269 import: bench-options
331270 type: exitcode-stdio-1.0
332− hs-source-dirs: .
333271 ghc-options: -with-rtsopts "-T -K1K -M128M"
334272 main-is: Streamly/Benchmark/Data/Array.hs
335273 other-modules: Streamly.Benchmark.Data.ArrayOps
@@ -337,7 +275,6 @@ benchmark unpinned-array
337275benchmark prim-array
338276 import: bench-options
339277 type: exitcode-stdio-1.0
340− hs-source-dirs: .
341278 ghc-options: -with-rtsopts "-T -K64K -M32M"
342279 main-is: Streamly/Benchmark/Data/Prim/Array.hs
343280 other-modules: Streamly.Benchmark.Data.Prim.ArrayOps
@@ -345,7 +282,6 @@ benchmark prim-array
345282benchmark small-array
346283 import: bench-options
347284 type: exitcode-stdio-1.0
348− hs-source-dirs: .
349285 ghc-options: -with-rtsopts "-T -K128K -M16M"
350286 main-is: Streamly/Benchmark/Data/SmallArray.hs
351287 other-modules: Streamly.Benchmark.Data.SmallArrayOps
@@ -353,7 +289,6 @@ benchmark small-array
353289benchmark array
354290 import: bench-options
355291 type: exitcode-stdio-1.0
356− hs-source-dirs: .
357292 ghc-options: -with-rtsopts "-T -K64K -M128M"
358293 main-is: Array.hs
359294 other-modules: ArrayOps
@@ -365,7 +300,6 @@ benchmark array
365300benchmark fileio
366301 import: bench-options
367302 type: exitcode-stdio-1.0
368− hs-source-dirs: .
369303 main-is: FileIO.hs
370304 other-modules: Streamly.Benchmark.FileIO.Array
371305 , Streamly.Benchmark.FileIO.Stream
@@ -379,7 +313,6 @@ benchmark fileio
379313executable chart
380314 default-language: Haskell2010
381315 ghc-options: -Wall
382− hs-source-dirs: .
383316 main-is: Chart.hs
384317 if flag(dev) && !flag(no-charts) && !impl(ghcjs)
385318 buildable: True