on master help sign in
Move LinearOps.hs benchmark file to streamly library

To facilitate inspection testing of all benchmarks.

commit11b10b9c0c1fbecc15743d68f715c4282160d1cc authorHarendra Kumar <harendra.kumar@gmail.com> dateFri 23 Aug 2019, 14:57 (7 years ago) parent44c950d
6 files changed+44−34
bench.sh+2−2 benchmark/Linear.hs+1−1 benchmark/LinearAsync.hs+1−1 benchmark/LinearRate.hs+1−1 benchmark/LinearOps.hs → src/Streamly/Benchmark/Prelude.hs+2−2 streamly.cabal+37−27
bench.sh+2−2
@@ -259,14 +259,14 @@ then
259259 WHICH_COMMAND="stack exec which"
260260 BUILD_CHART_EXE="stack build --flag streamly:dev"
261261 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"
263263else
264264 # XXX cabal issue "cabal v2-exec which" cannot find benchmark/test executables
265265 #WHICH_COMMAND="cabal v2-exec which"
266266 WHICH_COMMAND=cabal_which
267267 BUILD_CHART_EXE="cabal v2-build --flags dev chart"
268268 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"
270270fi
271271
272272#-----------------------------------------------------------------------------
benchmark/Linear.hs+1−1
@@ -16,7 +16,7 @@ import System.Random (randomRIO)
1616import Data.Monoid (Last(..))
1717
1818import qualified GHC.Exts as GHC
19−import qualified LinearOps as Ops
19+import qualified Streamly.Benchmark.Prelude as Ops
2020
2121import Streamly
2222import qualified Streamly.Fold as FL
benchmark/LinearAsync.hs+1−1
@@ -8,7 +8,7 @@
88import Control.DeepSeq (NFData)
99-- import Data.Functor.Identity (Identity, runIdentity)
1010import System.Random (randomRIO)
11−import qualified LinearOps as Ops
11+import qualified Streamly.Benchmark.Prelude as Ops
1212
1313import Streamly
1414import Gauge
benchmark/LinearRate.hs+1−1
@@ -10,7 +10,7 @@
1010
1111-- import Data.Functor.Identity (Identity, runIdentity)
1212import System.Random (randomRIO)
13−import qualified LinearOps as Ops
13+import qualified Streamly.Benchmark.Prelude as Ops
1414
1515import Streamly
1616import Gauge
benchmark/LinearOps.hs → src/Streamly/Benchmark/Prelude.hsrenamed+2−2
@@ -1,5 +1,5 @@
11-- |
2−-- Module : BenchmarkOps
2+-- Module : Streamly.Benchmark.Prelude
33-- Copyright : (c) 2018 Harendra Kumar
44--
55-- License : MIT
@@ -11,7 +11,7 @@
1111{-# LANGUAGE DeriveAnyClass #-}
1212{-# LANGUAGE DeriveGeneric #-}
1313
14−module LinearOps where
14+module Streamly.Benchmark.Prelude where
1515
1616import Control.Monad (when)
1717import Control.Monad.IO.Class (MonadIO)
streamly.cabal+37−27
@@ -329,6 +329,7 @@ library
329329 Streamly.Benchmark.Inspection
330330 , Streamly.Benchmark.FileIO.Array
331331 , Streamly.Benchmark.FileIO.Stream
332+ , Streamly.Benchmark.Prelude
332333
333334 build-depends: base >= 4.8 && < 5
334335 , ghc-prim >= 0.2 && < 0.6
@@ -524,16 +525,19 @@ benchmark linear
524525 type: exitcode-stdio-1.0
525526 hs-source-dirs: benchmark
526527 main-is: Linear.hs
527− other-modules: LinearOps
528− build-depends:
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)
528+ if flag(benchmark)
529+ buildable: True
535530 build-depends:
536− transformers >= 0.4 && < 0.6
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:
538+ transformers >= 0.4 && < 0.6
539+ else
540+ buildable: False
537541
538542benchmark linear-async
539543 import: bench-options
@@ -541,32 +545,38 @@ benchmark linear-async
541545 type: exitcode-stdio-1.0
542546 hs-source-dirs: benchmark
543547 main-is: LinearAsync.hs
544− other-modules: LinearOps
545− build-depends:
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)
548+ if flag(benchmark)
549+ buildable: True
552550 build-depends:
553− transformers >= 0.4 && < 0.6
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:
558+ transformers >= 0.4 && < 0.6
559+ else
560+ buildable: False
554561
555562benchmark linear-rate
556563 import: bench-options
557564 type: exitcode-stdio-1.0
558565 hs-source-dirs: benchmark
559566 main-is: LinearRate.hs
560− other-modules: LinearOps
561− build-depends:
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)
567+ if flag(benchmark)
568+ buildable: True
568569 build-depends:
569− transformers >= 0.4 && < 0.6
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:
577+ transformers >= 0.4 && < 0.6
578+ else
579+ buildable: False
570580
571581benchmark nested
572582 import: bench-options