on master help sign in
Reorganize benchmark modules
0b00efeHarendra Kumar
benchmark/LinearAsync.hs+1−1
@@ -10,7 +10,7 @@ import Control.DeepSeq (NFData)
10-- import Data.Functor.Identity (Identity, runIdentity)
10-- import Data.Functor.Identity (Identity, runIdentity)
11import System.Random (randomRIO)
11import System.Random (randomRIO)
12
12
13−import Common (parseCLIOpts)
13+import Streamly.Benchmark.Common (parseCLIOpts)
14
14
15import Streamly
15import Streamly
16import Gauge
16import Gauge
benchmark/LinearRate.hs+1−1
@@ -11,7 +11,7 @@
11-- import Data.Functor.Identity (Identity, runIdentity)
11-- import Data.Functor.Identity (Identity, runIdentity)
12import System.Random (randomRIO)
12import System.Random (randomRIO)
13
13
14−import Common (parseCLIOpts)
14+import Streamly.Benchmark.Common (parseCLIOpts)
15
15
16import Streamly
16import Streamly
17import Gauge
17import Gauge
benchmark/Nested.hs+1−1
@@ -9,7 +9,7 @@ import Control.DeepSeq (NFData)
9import Data.Functor.Identity (Identity, runIdentity)
9import Data.Functor.Identity (Identity, runIdentity)
10import System.Random (randomRIO)
10import System.Random (randomRIO)
11
11
12−import Common (parseCLIOpts)
12+import Streamly.Benchmark.Common (parseCLIOpts)
13
13
14import Streamly
14import Streamly
15import Gauge
15import Gauge
benchmark/NestedConcurrent.hs+1−1
@@ -10,7 +10,7 @@ import Control.Monad (when)
10import Data.Functor.Identity (Identity, runIdentity)
10import Data.Functor.Identity (Identity, runIdentity)
11import System.Random (randomRIO)
11import System.Random (randomRIO)
12
12
13−import Common (parseCLIOpts)
13+import Streamly.Benchmark.Common (parseCLIOpts)
14
14
15import Streamly
15import Streamly
16import Gauge
16import Gauge
benchmark/NestedUnfold.hs+1−1
@@ -8,7 +8,7 @@
8import Control.DeepSeq (NFData)
8import Control.DeepSeq (NFData)
9import System.Random (randomRIO)
9import System.Random (randomRIO)
10
10
11−import Common (parseCLIOpts)
11+import Streamly.Benchmark.Common (parseCLIOpts)
12
12
13import qualified NestedUnfoldOps as Ops
13import qualified NestedUnfoldOps as Ops
14
14
benchmark/Parallel.hs+1−1
@@ -10,7 +10,7 @@ import Control.DeepSeq (NFData)
10-- import Data.Functor.Identity (Identity, runIdentity)
10-- import Data.Functor.Identity (Identity, runIdentity)
11import System.Random (randomRIO)
11import System.Random (randomRIO)
12
12
13−import Common (parseCLIOpts)
13+import Streamly.Benchmark.Common (parseCLIOpts)
14
14
15import Streamly
15import Streamly
16import Gauge
16import Gauge
benchmark/exe/Prelude/Serial/O_1_Space.hs → benchmark/Streamly/Benchmark/Prelude/Serial/O_1_Space.hsrenamed+1−1
@@ -25,7 +25,7 @@ import qualified Streamly.Internal.Prelude as IP
25import qualified Streamly.Internal.Data.Pipe as Pipe
25import qualified Streamly.Internal.Data.Pipe as Pipe
26
26
27import Gauge
27import Gauge
28−import Common
28+import Streamly.Benchmark.Common
29
29
30-------------------------------------------------------------------------------
30-------------------------------------------------------------------------------
31--
31--
benchmark/exe/Prelude/Serial/O_n_Heap.hs → benchmark/Streamly/Benchmark/Prelude/Serial/O_n_Heap.hsrenamed+1−1
@@ -21,7 +21,7 @@ import qualified Streamly.Internal.Prelude as IP
21
21
22import Gauge
22import Gauge
23import Streamly
23import Streamly
24−import Common
24+import Streamly.Benchmark.Common
25
25
26-------------------------------------------------------------------------------
26-------------------------------------------------------------------------------
27--
27--
benchmark/exe/Prelude/Serial/O_n_Space.hs → benchmark/Streamly/Benchmark/Prelude/Serial/O_n_Space.hsrenamed+1−1
@@ -13,7 +13,7 @@ import qualified Streamly.Benchmark.Prelude as Ops
13
13
14import Streamly
14import Streamly
15import Gauge
15import Gauge
16−import Common
16+import Streamly.Benchmark.Common
17
17
18-------------------------------------------------------------------------------
18-------------------------------------------------------------------------------
19-- Benchmarking utilities
19-- Benchmarking utilities
benchmark/exe/Prelude/Serial/O_n_Stack.hs → benchmark/Streamly/Benchmark/Prelude/Serial/O_n_Stack.hsrenamed+1−2
@@ -8,12 +8,11 @@
8import Control.DeepSeq (NFData(..))
8import Control.DeepSeq (NFData(..))
9import System.Random (randomRIO)
9import System.Random (randomRIO)
10
10
11−import Common -- (parseCLIOpts)
12−
13import qualified Streamly.Benchmark.Prelude as Ops
11import qualified Streamly.Benchmark.Prelude as Ops
14
12
15import Streamly
13import Streamly
16import Gauge
14import Gauge
15+import Streamly.Benchmark.Common
17
16
18-------------------------------------------------------------------------------
17-------------------------------------------------------------------------------
19--
18--
benchmark/Common.hs → benchmark/lib/Streamly/Benchmark/Common.hsrenamed+2−2
@@ -4,13 +4,13 @@
4#endif
4#endif
5
5
6-- |
6-- |
7−-- Module : Main
7+-- Module : Streamly.Benchmark.Common
8-- Copyright : (c) 2019 Composewell Technologies
8-- Copyright : (c) 2019 Composewell Technologies
9--
9--
10-- License : BSD3
10-- License : BSD3
11-- Maintainer : streamly@composewell.com
11-- Maintainer : streamly@composewell.com
12
12
13−module Common
13+module Streamly.Benchmark.Common
14 ( parseCLIOpts
14 ( parseCLIOpts
15
15
16 , benchIOSink1
16 , benchIOSink1
benchmark/Streamly/Benchmark/Prelude.hs → benchmark/lib/Streamly/Benchmark/Prelude.hsrenamed

The content is the same.

benchmark/streamly-benchmarks.cabal+27−94
@@ -95,55 +95,6 @@ common optimization-options
95common lib-options
95common lib-options
96 import: compile-options, optimization-options
96 import: compile-options, optimization-options
97
97
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−
147common bench-depends
98common bench-depends
148 build-depends:
99 build-depends:
149 -- Core libraries shipped with ghc, the min and max
100 -- Core libraries shipped with ghc, the min and max
@@ -154,7 +105,6 @@ common bench-depends
154 , mtl >= 2.2 && < 3
105 , mtl >= 2.2 && < 3
155
106
156 -- other libraries
107 -- other libraries
157− , streamly-benchmarks
158 , streamly >= 0.7.0
108 , streamly >= 0.7.0
159 , random >= 1.0 && < 2.0
109 , random >= 1.0 && < 2.0
160 , gauge >= 0.2.4 && < 0.3
110 , gauge >= 0.2.4 && < 0.3
@@ -167,6 +117,25 @@ common bench-depends
167 if flag(inspection)
117 if flag(inspection)
168 build-depends: template-haskell >= 2.14 && < 2.16
118 build-depends: template-haskell >= 2.14 && < 2.16
169 , inspection-testing >= 0.4 && < 0.5
119 , 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+-------------------------------------------------------------------------------
170
139
171-- Whatever stack size below 32K we use GHC seems to report the stack size as
140-- Whatever stack size below 32K we use GHC seems to report the stack size as
172-- 32K at crash. Even K0K works. Therefore it probably does not make sense to
141-- 32K at crash. Even K0K works. Therefore it probably does not make sense to
@@ -175,6 +144,8 @@ common bench-depends
175common bench-options
144common bench-options
176 import: compile-options, optimization-options, bench-depends
145 import: compile-options, optimization-options, bench-depends
177 ghc-options: -with-rtsopts "-T -K32K -M16M"
146 ghc-options: -with-rtsopts "-T -K32K -M16M"
147+ build-depends: streamly-benchmarks
148+ hs-source-dirs: .
178
149
179-- Some benchmarks are threaded some are not
150-- Some benchmarks are threaded some are not
180common bench-options-threaded
151common bench-options-threaded
@@ -182,6 +153,8 @@ common bench-options-threaded
182 -- -threaded and -N2 is important because some GC and space leak issues
153 -- -threaded and -N2 is important because some GC and space leak issues
183 -- trigger only with these options.
154 -- trigger only with these options.
184 ghc-options: -threaded -with-rtsopts "-T -N2 -K32K -M16M"
155 ghc-options: -threaded -with-rtsopts "-T -N2 -K32K -M16M"
156+ build-depends: streamly-benchmarks
157+ hs-source-dirs: .
185
158
186-------------------------------------------------------------------------------
159-------------------------------------------------------------------------------
187-- Serial Streams
160-- Serial Streams
@@ -192,50 +165,36 @@ benchmark linear
192 import: bench-options
165 import: bench-options
193 type: exitcode-stdio-1.0
166 type: exitcode-stdio-1.0
194 ghc-options: -with-rtsopts "-T -K36K -M16M"
167 ghc-options: -with-rtsopts "-T -K36K -M16M"
195− hs-source-dirs: exe
196− main-is: Prelude/Serial/O_1_Space.hs
168+ main-is: Streamly/Benchmark/Prelude/Serial/O_1_Space.hs
197− build-depends:
198− lib-prelude
199
169
200benchmark serial-O-n-heap
170benchmark serial-O-n-heap
201 import: bench-options
171 import: bench-options
202 type: exitcode-stdio-1.0
172 type: exitcode-stdio-1.0
203 ghc-options: -with-rtsopts "-T -K36K -M128M"
173 ghc-options: -with-rtsopts "-T -K36K -M128M"
204− hs-source-dirs: exe
205− main-is: Prelude/Serial/O_n_Heap.hs
174+ main-is: Streamly/Benchmark/Prelude/Serial/O_n_Heap.hs
206− build-depends:
207− lib-prelude
208
175
209benchmark serial-O-n-stack
176benchmark serial-O-n-stack
210 import: bench-options
177 import: bench-options
211 type: exitcode-stdio-1.0
178 type: exitcode-stdio-1.0
212 ghc-options: -with-rtsopts "-T -K1M -M16M"
179 ghc-options: -with-rtsopts "-T -K1M -M16M"
213− hs-source-dirs: exe
214− main-is: Prelude/Serial/O_n_Stack.hs
180+ main-is: Streamly/Benchmark/Prelude/Serial/O_n_Stack.hs
215− build-depends:
216− lib-prelude
217
181
218benchmark serial-O-n-space
182benchmark serial-O-n-space
219 import: bench-options
183 import: bench-options
220 type: exitcode-stdio-1.0
184 type: exitcode-stdio-1.0
221 ghc-options: -with-rtsopts "-T -K16M -M64M"
185 ghc-options: -with-rtsopts "-T -K16M -M64M"
222− hs-source-dirs: exe
223− main-is: Prelude/Serial/O_n_Space.hs
186+ main-is: Streamly/Benchmark/Prelude/Serial/O_n_Space.hs
224− build-depends:
225− lib-prelude
226
187
227benchmark nested
188benchmark nested
228 import: bench-options
189 import: bench-options
229 type: exitcode-stdio-1.0
190 type: exitcode-stdio-1.0
230 ghc-options: -with-rtsopts "-T -K256K -M16M"
191 ghc-options: -with-rtsopts "-T -K256K -M16M"
231− hs-source-dirs: .
232 main-is: Nested.hs
192 main-is: Nested.hs
233 other-modules: NestedOps
193 other-modules: NestedOps
234
194
235benchmark nested-unfold
195benchmark nested-unfold
236 import: bench-options
196 import: bench-options
237 type: exitcode-stdio-1.0
197 type: exitcode-stdio-1.0
238− hs-source-dirs: .
239 ghc-options: -with-rtsopts "-T -K64K -M16M"
198 ghc-options: -with-rtsopts "-T -K64K -M16M"
240 main-is: NestedUnfold.hs
199 main-is: NestedUnfold.hs
241 other-modules: NestedUnfoldOps
200 other-modules: NestedUnfoldOps
@@ -243,7 +202,6 @@ benchmark nested-unfold
243benchmark base
202benchmark base
244 import: bench-options
203 import: bench-options
245 type: exitcode-stdio-1.0
204 type: exitcode-stdio-1.0
246− hs-source-dirs: .
247 if flag(dev)
205 if flag(dev)
248 cpp-options: -DDEVBUILD
206 cpp-options: -DDEVBUILD
249 ghc-options: -with-rtsopts "-T -K2M -M16M"
207 ghc-options: -with-rtsopts "-T -K2M -M16M"
@@ -256,7 +214,6 @@ benchmark base
256
214
257executable nano-bench
215executable nano-bench
258 import: bench-options
216 import: bench-options
259− hs-source-dirs: .
260 main-is: NanoBenchmarks.hs
217 main-is: NanoBenchmarks.hs
261 if flag(dev)
218 if flag(dev)
262 buildable: True
219 buildable: True
@@ -270,16 +227,12 @@ executable nano-bench
270benchmark linear-async
227benchmark linear-async
271 import: bench-options-threaded
228 import: bench-options-threaded
272 type: exitcode-stdio-1.0
229 type: exitcode-stdio-1.0
273− hs-source-dirs: .
274 ghc-options: -with-rtsopts "-T -N2 -K64K -M16M"
230 ghc-options: -with-rtsopts "-T -N2 -K64K -M16M"
275 main-is: LinearAsync.hs
231 main-is: LinearAsync.hs
276− build-depends:
277− lib-prelude
278
232
279benchmark nested-concurrent
233benchmark nested-concurrent
280 import: bench-options-threaded
234 import: bench-options-threaded
281 type: exitcode-stdio-1.0
235 type: exitcode-stdio-1.0
282− hs-source-dirs: .
283 -- XXX this can be lowered once we split out the finite benchmarks
236 -- XXX this can be lowered once we split out the finite benchmarks
284 ghc-options: -with-rtsopts "-T -N2 -K256K -M128M"
237 ghc-options: -with-rtsopts "-T -N2 -K256K -M128M"
285 main-is: NestedConcurrent.hs
238 main-is: NestedConcurrent.hs
@@ -288,39 +241,25 @@ benchmark nested-concurrent
288benchmark parallel
241benchmark parallel
289 import: bench-options-threaded
242 import: bench-options-threaded
290 type: exitcode-stdio-1.0
243 type: exitcode-stdio-1.0
291− hs-source-dirs: .
292 ghc-options: -with-rtsopts "-T -N2 -K128K -M256M"
244 ghc-options: -with-rtsopts "-T -N2 -K128K -M256M"
293 main-is: Parallel.hs
245 main-is: Parallel.hs
294 other-modules: NestedOps
246 other-modules: NestedOps
295− build-depends:
296− lib-prelude
297
247
298benchmark concurrent
248benchmark concurrent
299 import: bench-options-threaded
249 import: bench-options-threaded
300 type: exitcode-stdio-1.0
250 type: exitcode-stdio-1.0
301− hs-source-dirs: .
302 main-is: Concurrent.hs
251 main-is: Concurrent.hs
303 ghc-options: -with-rtsopts "-T -N2 -K256K -M384M"
252 ghc-options: -with-rtsopts "-T -N2 -K256K -M384M"
304
253
305benchmark adaptive
254benchmark adaptive
306 import: bench-options-threaded
255 import: bench-options-threaded
307 type: exitcode-stdio-1.0
256 type: exitcode-stdio-1.0
308− hs-source-dirs: .
309 main-is: Adaptive.hs
257 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
316
258
317benchmark linear-rate
259benchmark linear-rate
318 import: bench-options-threaded
260 import: bench-options-threaded
319 type: exitcode-stdio-1.0
261 type: exitcode-stdio-1.0
320− hs-source-dirs: .
321 main-is: LinearRate.hs
262 main-is: LinearRate.hs
322− build-depends:
323− lib-prelude
324
263
325-------------------------------------------------------------------------------
264-------------------------------------------------------------------------------
326-- Array Benchmarks
265-- Array Benchmarks
@@ -329,7 +268,6 @@ benchmark linear-rate
329benchmark unpinned-array
268benchmark unpinned-array
330 import: bench-options
269 import: bench-options
331 type: exitcode-stdio-1.0
270 type: exitcode-stdio-1.0
332− hs-source-dirs: .
333 ghc-options: -with-rtsopts "-T -K1K -M128M"
271 ghc-options: -with-rtsopts "-T -K1K -M128M"
334 main-is: Streamly/Benchmark/Data/Array.hs
272 main-is: Streamly/Benchmark/Data/Array.hs
335 other-modules: Streamly.Benchmark.Data.ArrayOps
273 other-modules: Streamly.Benchmark.Data.ArrayOps
@@ -337,7 +275,6 @@ benchmark unpinned-array
337benchmark prim-array
275benchmark prim-array
338 import: bench-options
276 import: bench-options
339 type: exitcode-stdio-1.0
277 type: exitcode-stdio-1.0
340− hs-source-dirs: .
341 ghc-options: -with-rtsopts "-T -K64K -M32M"
278 ghc-options: -with-rtsopts "-T -K64K -M32M"
342 main-is: Streamly/Benchmark/Data/Prim/Array.hs
279 main-is: Streamly/Benchmark/Data/Prim/Array.hs
343 other-modules: Streamly.Benchmark.Data.Prim.ArrayOps
280 other-modules: Streamly.Benchmark.Data.Prim.ArrayOps
@@ -345,7 +282,6 @@ benchmark prim-array
345benchmark small-array
282benchmark small-array
346 import: bench-options
283 import: bench-options
347 type: exitcode-stdio-1.0
284 type: exitcode-stdio-1.0
348− hs-source-dirs: .
349 ghc-options: -with-rtsopts "-T -K128K -M16M"
285 ghc-options: -with-rtsopts "-T -K128K -M16M"
350 main-is: Streamly/Benchmark/Data/SmallArray.hs
286 main-is: Streamly/Benchmark/Data/SmallArray.hs
351 other-modules: Streamly.Benchmark.Data.SmallArrayOps
287 other-modules: Streamly.Benchmark.Data.SmallArrayOps
@@ -353,7 +289,6 @@ benchmark small-array
353benchmark array
289benchmark array
354 import: bench-options
290 import: bench-options
355 type: exitcode-stdio-1.0
291 type: exitcode-stdio-1.0
356− hs-source-dirs: .
357 ghc-options: -with-rtsopts "-T -K64K -M128M"
292 ghc-options: -with-rtsopts "-T -K64K -M128M"
358 main-is: Array.hs
293 main-is: Array.hs
359 other-modules: ArrayOps
294 other-modules: ArrayOps
@@ -365,7 +300,6 @@ benchmark array
365benchmark fileio
300benchmark fileio
366 import: bench-options
301 import: bench-options
367 type: exitcode-stdio-1.0
302 type: exitcode-stdio-1.0
368− hs-source-dirs: .
369 main-is: FileIO.hs
303 main-is: FileIO.hs
370 other-modules: Streamly.Benchmark.FileIO.Array
304 other-modules: Streamly.Benchmark.FileIO.Array
371 , Streamly.Benchmark.FileIO.Stream
305 , Streamly.Benchmark.FileIO.Stream
@@ -379,7 +313,6 @@ benchmark fileio
379executable chart
313executable chart
380 default-language: Haskell2010
314 default-language: Haskell2010
381 ghc-options: -Wall
315 ghc-options: -Wall
382− hs-source-dirs: .
383 main-is: Chart.hs
316 main-is: Chart.hs
384 if flag(dev) && !flag(no-charts) && !impl(ghcjs)
317 if flag(dev) && !flag(no-charts) && !impl(ghcjs)
385 buildable: True
318 buildable: True
streamly.cabal+2−2
@@ -122,11 +122,11 @@ extra-source-files:
122 benchmark/streamly-benchmarks.cabal
122 benchmark/streamly-benchmarks.cabal
123 benchmark/README.md
123 benchmark/README.md
124 benchmark/*.hs
124 benchmark/*.hs
125+ benchmark/lib/Streamly/Benchmark/*.hs
125 benchmark/Streamly/Benchmark/Data/*.hs
126 benchmark/Streamly/Benchmark/Data/*.hs
126 benchmark/Streamly/Benchmark/Data/Prim/*.hs
127 benchmark/Streamly/Benchmark/Data/Prim/*.hs
127 benchmark/Streamly/Benchmark/FileIO/*.hs
128 benchmark/Streamly/Benchmark/FileIO/*.hs
128− benchmark/Streamly/Benchmark/*.hs
129+ benchmark/Streamly/Benchmark/Prelude/Serial/*.hs
129− benchmark/exe/Prelude/Serial/*.hs
130
130
131extra-tmp-files:
131extra-tmp-files:
132 config.log
132 config.log