on master help sign in
Move LinearOps.hs benchmark file to streamly library
11b10b9Harendra Kumar
bench.sh+2−2
@@ -259,14 +259,14 @@ then
259 WHICH_COMMAND="stack exec which"
259 WHICH_COMMAND="stack exec which"
260 BUILD_CHART_EXE="stack build --flag streamly:dev"
260 BUILD_CHART_EXE="stack build --flag streamly:dev"
261 GET_BENCH_PROG=stack_bench_prog
261 GET_BENCH_PROG=stack_bench_prog
262− BUILD_BENCH="stack build $STACK_BUILD_FLAGS --bench --no-run-benchmarks"
262+ BUILD_BENCH="stack build $STACK_BUILD_FLAGS --flags "streamly:benchmark" --bench --no-run-benchmarks"
263else
263else
264 # XXX cabal issue "cabal v2-exec which" cannot find benchmark/test executables
264 # XXX cabal issue "cabal v2-exec which" cannot find benchmark/test executables
265 #WHICH_COMMAND="cabal v2-exec which"
265 #WHICH_COMMAND="cabal v2-exec which"
266 WHICH_COMMAND=cabal_which
266 WHICH_COMMAND=cabal_which
267 BUILD_CHART_EXE="cabal v2-build --flags dev chart"
267 BUILD_CHART_EXE="cabal v2-build --flags dev chart"
268 GET_BENCH_PROG=cabal_bench_prog
268 GET_BENCH_PROG=cabal_bench_prog
269− BUILD_BENCH="cabal v2-build $CABAL_BUILD_FLAGS --enable-benchmarks"
269+ BUILD_BENCH="cabal v2-build $CABAL_BUILD_FLAGS --flag benchmark --enable-benchmarks"
270fi
270fi
271
271
272#-----------------------------------------------------------------------------
272#-----------------------------------------------------------------------------
benchmark/Linear.hs+1−1
@@ -16,7 +16,7 @@ import System.Random (randomRIO)
16import Data.Monoid (Last(..))
16import Data.Monoid (Last(..))
17
17
18import qualified GHC.Exts as GHC
18import qualified GHC.Exts as GHC
19−import qualified LinearOps as Ops
19+import qualified Streamly.Benchmark.Prelude as Ops
20
20
21import Streamly
21import Streamly
22import qualified Streamly.Fold as FL
22import qualified Streamly.Fold as FL
benchmark/LinearAsync.hs+1−1
@@ -8,7 +8,7 @@
8import Control.DeepSeq (NFData)
8import Control.DeepSeq (NFData)
9-- import Data.Functor.Identity (Identity, runIdentity)
9-- import Data.Functor.Identity (Identity, runIdentity)
10import System.Random (randomRIO)
10import System.Random (randomRIO)
11−import qualified LinearOps as Ops
11+import qualified Streamly.Benchmark.Prelude as Ops
12
12
13import Streamly
13import Streamly
14import Gauge
14import Gauge
benchmark/LinearRate.hs+1−1
@@ -10,7 +10,7 @@
10
10
11-- import Data.Functor.Identity (Identity, runIdentity)
11-- import Data.Functor.Identity (Identity, runIdentity)
12import System.Random (randomRIO)
12import System.Random (randomRIO)
13−import qualified LinearOps as Ops
13+import qualified Streamly.Benchmark.Prelude as Ops
14
14
15import Streamly
15import Streamly
16import Gauge
16import Gauge
benchmark/LinearOps.hs → src/Streamly/Benchmark/Prelude.hsrenamed+2−2
@@ -1,5 +1,5 @@
1-- |
1-- |
2−-- Module : BenchmarkOps
2+-- Module : Streamly.Benchmark.Prelude
3-- Copyright : (c) 2018 Harendra Kumar
3-- Copyright : (c) 2018 Harendra Kumar
4--
4--
5-- License : MIT
5-- License : MIT
@@ -11,7 +11,7 @@
11{-# LANGUAGE DeriveAnyClass #-}
11{-# LANGUAGE DeriveAnyClass #-}
12{-# LANGUAGE DeriveGeneric #-}
12{-# LANGUAGE DeriveGeneric #-}
13
13
14−module LinearOps where
14+module Streamly.Benchmark.Prelude where
15
15
16import Control.Monad (when)
16import Control.Monad (when)
17import Control.Monad.IO.Class (MonadIO)
17import Control.Monad.IO.Class (MonadIO)
streamly.cabal+37−27
@@ -329,6 +329,7 @@ library
329 Streamly.Benchmark.Inspection
329 Streamly.Benchmark.Inspection
330 , Streamly.Benchmark.FileIO.Array
330 , Streamly.Benchmark.FileIO.Array
331 , Streamly.Benchmark.FileIO.Stream
331 , Streamly.Benchmark.FileIO.Stream
332+ , Streamly.Benchmark.Prelude
332
333
333 build-depends: base >= 4.8 && < 5
334 build-depends: base >= 4.8 && < 5
334 , ghc-prim >= 0.2 && < 0.6
335 , ghc-prim >= 0.2 && < 0.6
@@ -524,16 +525,19 @@ benchmark linear
524 type: exitcode-stdio-1.0
525 type: exitcode-stdio-1.0
525 hs-source-dirs: benchmark
526 hs-source-dirs: benchmark
526 main-is: Linear.hs
527 main-is: Linear.hs
527− other-modules: LinearOps
528+ if flag(benchmark)
528− build-depends:
529+ buildable: True
529− streamly
530− , base >= 4.8 && < 5
531− , deepseq >= 1.4.1 && < 1.5
532− , random >= 1.0 && < 2.0
533− , gauge >= 0.2.4 && < 0.3
534− if impl(ghc < 8.0)
535 build-depends:
530 build-depends:
531+ streamly
532+ , base >= 4.8 && < 5
533+ , deepseq >= 1.4.1 && < 1.5
534+ , random >= 1.0 && < 2.0
535+ , gauge >= 0.2.4 && < 0.3
536+ if impl(ghc < 8.0)
537+ build-depends:
536− transformers >= 0.4 && < 0.6
538+ transformers >= 0.4 && < 0.6
539+ else
540+ buildable: False
537
541
538benchmark linear-async
542benchmark linear-async
539 import: bench-options
543 import: bench-options
@@ -541,32 +545,38 @@ benchmark linear-async
541 type: exitcode-stdio-1.0
545 type: exitcode-stdio-1.0
542 hs-source-dirs: benchmark
546 hs-source-dirs: benchmark
543 main-is: LinearAsync.hs
547 main-is: LinearAsync.hs
544− other-modules: LinearOps
548+ if flag(benchmark)
545− build-depends:
549+ buildable: True
546− streamly
547− , base >= 4.8 && < 5
548− , deepseq >= 1.4.1 && < 1.5
549− , random >= 1.0 && < 2.0
550− , gauge >= 0.2.4 && < 0.3
551− if impl(ghc < 8.0)
552 build-depends:
550 build-depends:
551+ streamly
552+ , base >= 4.8 && < 5
553+ , deepseq >= 1.4.1 && < 1.5
554+ , random >= 1.0 && < 2.0
555+ , gauge >= 0.2.4 && < 0.3
556+ if impl(ghc < 8.0)
557+ build-depends:
553− transformers >= 0.4 && < 0.6
558+ transformers >= 0.4 && < 0.6
559+ else
560+ buildable: False
554
561
555benchmark linear-rate
562benchmark linear-rate
556 import: bench-options
563 import: bench-options
557 type: exitcode-stdio-1.0
564 type: exitcode-stdio-1.0
558 hs-source-dirs: benchmark
565 hs-source-dirs: benchmark
559 main-is: LinearRate.hs
566 main-is: LinearRate.hs
560− other-modules: LinearOps
567+ if flag(benchmark)
561− build-depends:
568+ buildable: True
562− streamly
563− , base >= 4.8 && < 5
564− , deepseq >= 1.4.1 && < 1.5
565− , random >= 1.0 && < 2.0
566− , gauge >= 0.2.4 && < 0.3
567− if impl(ghc < 8.0)
568 build-depends:
569 build-depends:
570+ streamly
571+ , base >= 4.8 && < 5
572+ , deepseq >= 1.4.1 && < 1.5
573+ , random >= 1.0 && < 2.0
574+ , gauge >= 0.2.4 && < 0.3
575+ if impl(ghc < 8.0)
576+ build-depends:
569− transformers >= 0.4 && < 0.6
577+ transformers >= 0.4 && < 0.6
578+ else
579+ buildable: False
570
580
571benchmark nested
581benchmark nested
572 import: bench-options
582 import: bench-options