on master help sign in
Move Benchmark* to benchmark/ + Rm benchmark flag
commitea875a020e4cf73a8e9dc0d5858fa7cffe43466a authoradithyaov <adi.obilisetty@gmail.com> dateThu 12 Dec 2019, 01:07 (7 years ago) parent333dc66
10 files changed+69−77
.travis.yml+1−1 benchmark/FileIO.hs+2−2 benchmark/Linear.hs+1−1 benchmark/LinearAsync.hs+1−1 benchmark/LinearRate.hs+1−1 src/Streamly/Internal/Benchmark/FileIO/Array.hs → benchmark/Streamly/Benchmark/FileIO/Array.hs+2−2 src/Streamly/Internal/Benchmark/FileIO/Stream.hs → benchmark/Streamly/Benchmark/FileIO/Stream.hs+2−2 src/Streamly/Internal/Benchmark/Prelude.hs → benchmark/Streamly/Benchmark/Prelude.hs+2−2 cabal.project.ci+1−2 streamly.cabal+56−63
.travis.yml+1−1
@@ -136,7 +136,7 @@ matrix:
136136 #- env: BUILD=stack RESOLVER=nightly
137137 # addons: {apt: {packages: [cabal-install-1.24], sources: [hvr-ghc]}}
138138
139− - env: BUILD=stack RESOLVER=lts-13 GHCVER=8.6 STACK_BUILD_OPTIONS="--flag streamly:examples-sdl --flag streamly:benchmark"
139+ - env: BUILD=stack RESOLVER=lts-13 GHCVER=8.6 STACK_BUILD_OPTIONS="--flag streamly:examples-sdl"
140140 addons: {apt: {packages: [cabal-install-2.4,libsdl1.2-dev], sources: [hvr-ghc]}}
141141
142142 #- env: BUILD=stack RESOLVER=lts-12 GHCVER=8.4
benchmark/FileIO.hs+2−2
@@ -14,8 +14,8 @@ import System.Process.Typed (shell, runProcess_)
1414import Data.IORef
1515import Gauge
1616
17−import qualified Streamly.Internal.Benchmark.FileIO.Stream as BFS
18−import qualified Streamly.Internal.Benchmark.FileIO.Array as BFA
17+import qualified Streamly.Benchmark.FileIO.Stream as BFS
18+import qualified Streamly.Benchmark.FileIO.Array as BFA
1919
2020-- Input and output file handles
2121data Handles = Handles Handle Handle
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 Streamly.Internal.Benchmark.Prelude as Ops
19+import qualified Streamly.Benchmark.Prelude as Ops
2020
2121import Streamly
2222import qualified Streamly.Data.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 Streamly.Internal.Benchmark.Prelude 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 Streamly.Internal.Benchmark.Prelude as Ops
13+import qualified Streamly.Benchmark.Prelude as Ops
1414
1515import Streamly
1616import Gauge
src/Streamly/Internal/Benchmark/FileIO/Array.hs → benchmark/Streamly/Benchmark/FileIO/Array.hsrenamed+2−2
@@ -1,5 +1,5 @@
11-- |
2−-- Module : Streamly.Internal.Benchmark.FileIO.Array
2+-- Module : Streamly.Benchmark.FileIO.Array
33-- Copyright : (c) 2019 Composewell Technologies
44--
55-- License : BSD3
@@ -18,7 +18,7 @@
1818{-# OPTIONS_GHC -fplugin Test.Inspection.Plugin #-}
1919#endif
2020
21−module Streamly.Internal.Benchmark.FileIO.Array
21+module Streamly.Benchmark.FileIO.Array
2222 (
2323 last
2424 , countBytes
src/Streamly/Internal/Benchmark/FileIO/Stream.hs → benchmark/Streamly/Benchmark/FileIO/Stream.hsrenamed+2−2
@@ -1,5 +1,5 @@
11-- |
2−-- Module : Streamly.Internal.Benchmark.FileIO.Stream
2+-- Module : Streamly.Benchmark.FileIO.Stream
33-- Copyright : (c) 2019 Composewell Technologies
44--
55-- License : BSD3
@@ -19,7 +19,7 @@
1919{-# OPTIONS_GHC -fplugin Test.Inspection.Plugin #-}
2020#endif
2121
22−module Streamly.Internal.Benchmark.FileIO.Stream
22+module Streamly.Benchmark.FileIO.Stream
2323 (
2424 -- * FileIO
2525 last
src/Streamly/Internal/Benchmark/Prelude.hs → benchmark/Streamly/Benchmark/Prelude.hsrenamed+2−2
@@ -1,5 +1,5 @@
11-- |
2−-- Module : Streamly.Internal.Benchmark.Prelude
2+-- Module : Streamly.Benchmark.Prelude
33-- Copyright : (c) 2018 Harendra Kumar
44--
55-- License : MIT
@@ -20,7 +20,7 @@
2020{-# OPTIONS_GHC -fplugin Test.Inspection.Plugin #-}
2121#endif
2222
23−module Streamly.Internal.Benchmark.Prelude where
23+module Streamly.Benchmark.Prelude where
2424
2525import Control.DeepSeq (NFData)
2626import Control.Monad (when)
cabal.project.ci+1−2
@@ -3,5 +3,4 @@ packages:
33
44package streamly
55 ghc-options: -Werror
6− flags: benchmark
7− inspection
6+ flags: inspection
streamly.cabal+56−63
@@ -134,11 +134,6 @@ source-repository head
134134 type: git
135135 location: https://github.com/composewell/streamly
136136
137−flag benchmark
138− description: Benchmark build
139− manual: True
140− default: False
141−
142137flag inspection
143138 description: Enable inspection testing
144139 manual: True
@@ -257,6 +252,7 @@ common exe-options
257252common bench-options
258253 import: compile-options, optimization-options
259254 ghc-options: -with-rtsopts "-T"
255+ build-depends: mtl >= 2.2 && < 3
260256
261257-------------------------------------------------------------------------------
262258-- Library
@@ -354,12 +350,6 @@ library
354350 , Streamly.Internal.Network.Socket
355351 , Streamly.Internal.Network.Inet.TCP
356352
357− if flag(benchmark)
358− exposed-modules:
359− Streamly.Internal.Benchmark.FileIO.Array
360− , Streamly.Internal.Benchmark.FileIO.Stream
361− , Streamly.Internal.Benchmark.Prelude
362−
363353 build-depends: base >= 4.8 && < 5
364354 , ghc-prim >= 0.2 && < 0.6
365355 , deepseq >= 1.4.1 && < 1.5
@@ -379,10 +369,6 @@ library
379369 , transformers >= 0.4 && < 0.6
380370 , transformers-base >= 0.4 && < 0.5
381371
382− if flag(inspection)
383− build-depends: template-haskell >= 2.14 && < 2.16
384− , inspection-testing >= 0.4 && < 0.5
385−
386372 if !impl(ghcjs)
387373 build-depends:
388374 network >= 2.6 && < 4
@@ -571,61 +557,64 @@ test-suite parallel-loops
571557
572558benchmark linear
573559 import: bench-options
560+ other-modules: Streamly.Benchmark.Prelude
574561 type: exitcode-stdio-1.0
575562 hs-source-dirs: benchmark
576563 main-is: Linear.hs
577− if flag(benchmark)
578− buildable: True
564+ buildable: True
565+ build-depends:
566+ streamly
567+ , base >= 4.8 && < 5
568+ , deepseq >= 1.4.1 && < 1.5
569+ , random >= 1.0 && < 2.0
570+ , gauge >= 0.2.4 && < 0.3
571+ if impl(ghc < 8.0)
579572 build-depends:
580− streamly
581− , base >= 4.8 && < 5
582− , deepseq >= 1.4.1 && < 1.5
583− , random >= 1.0 && < 2.0
584− , gauge >= 0.2.4 && < 0.3
585− if impl(ghc < 8.0)
586− build-depends:
587− transformers >= 0.4 && < 0.6
588− else
589− buildable: False
573+ transformers >= 0.4 && < 0.6
574+ if flag(inspection)
575+ build-depends: template-haskell >= 2.14 && < 2.16
576+ , inspection-testing >= 0.4 && < 0.5
590577
591578benchmark linear-async
592579 import: bench-options
580+ other-modules: Streamly.Benchmark.Prelude
593581 cpp-options: -DLINEAR_ASYNC
594582 type: exitcode-stdio-1.0
595583 hs-source-dirs: benchmark
596584 main-is: LinearAsync.hs
597− if flag(benchmark)
598− buildable: True
585+ buildable: True
586+ build-depends:
587+ streamly
588+ , base >= 4.8 && < 5
589+ , deepseq >= 1.4.1 && < 1.5
590+ , random >= 1.0 && < 2.0
591+ , gauge >= 0.2.4 && < 0.3
592+ if impl(ghc < 8.0)
599593 build-depends:
600− streamly
601− , base >= 4.8 && < 5
602− , deepseq >= 1.4.1 && < 1.5
603− , random >= 1.0 && < 2.0
604− , gauge >= 0.2.4 && < 0.3
605− if impl(ghc < 8.0)
606− build-depends:
607− transformers >= 0.4 && < 0.6
608− else
609− buildable: False
594+ transformers >= 0.4 && < 0.6
595+ if flag(inspection)
596+ build-depends: template-haskell >= 2.14 && < 2.16
597+ , inspection-testing >= 0.4 && < 0.5
610598
611599benchmark linear-rate
612600 import: bench-options
601+ other-modules: Streamly.Benchmark.Prelude
613602 type: exitcode-stdio-1.0
614603 hs-source-dirs: benchmark
615604 main-is: LinearRate.hs
616− if flag(benchmark)
617− buildable: True
605+ buildable: True
606+ build-depends:
607+ streamly
608+ , base >= 4.8 && < 5
609+ , deepseq >= 1.4.1 && < 1.5
610+ , random >= 1.0 && < 2.0
611+ , gauge >= 0.2.4 && < 0.3
612+ if impl(ghc < 8.0)
618613 build-depends:
619− streamly
620− , base >= 4.8 && < 5
621− , deepseq >= 1.4.1 && < 1.5
622− , random >= 1.0 && < 2.0
623− , gauge >= 0.2.4 && < 0.3
624− if impl(ghc < 8.0)
625− build-depends:
626− transformers >= 0.4 && < 0.6
627− else
628− buildable: False
614+ transformers >= 0.4 && < 0.6
615+ if flag(inspection)
616+ build-depends: template-haskell >= 2.14 && < 2.16
617+ , inspection-testing >= 0.4 && < 0.5
629618
630619benchmark nested
631620 import: bench-options
@@ -709,22 +698,24 @@ benchmark array
709698
710699benchmark fileio
711700 import: bench-options
701+ other-modules: Streamly.Benchmark.FileIO.Array
702+ , Streamly.Benchmark.FileIO.Stream
712703 type: exitcode-stdio-1.0
713704 -- A value of 400 works better for some benchmarks, however, it takes
714705 -- extraordinary amount of time to compile with that.
715706 -- ghc-options: -funfolding-use-threshold=150
716707 hs-source-dirs: benchmark
717708 main-is: FileIO.hs
718− if flag(benchmark)
719− buildable: True
720− build-depends:
721− streamly
722− , base >= 4.8 && < 5
723− , gauge >= 0.2.4 && < 0.3
724− , typed-process >= 0.2.3 && < 0.3
725− , deepseq >= 1.4.1 && < 1.5
726− else
727− buildable: False
709+ buildable: True
710+ build-depends:
711+ streamly
712+ , base >= 4.8 && < 5
713+ , gauge >= 0.2.4 && < 0.3
714+ , typed-process >= 0.2.3 && < 0.3
715+ , deepseq >= 1.4.1 && < 1.5
716+ if flag(inspection)
717+ build-depends: template-haskell >= 2.14 && < 2.16
718+ , inspection-testing >= 0.4 && < 0.5
728719
729720benchmark concurrent
730721 import: bench-options
@@ -750,7 +741,8 @@ benchmark concurrent
750741benchmark base
751742 import: bench-options
752743 type: exitcode-stdio-1.0
753− include-dirs: src/Streamly/Internal/Data/Time
744+ include-dirs: src/Streamly/Internal/Data/Time
745+ src
754746 if os(windows)
755747 c-sources: src/Streamly/Internal/Data/Time/Windows.c
756748 if os(darwin)
@@ -805,7 +797,8 @@ benchmark base
805797executable nano-bench
806798 import: bench-options
807799 hs-source-dirs: benchmark, src
808− include-dirs: src/Streamly/Internal/Data/Time
800+ include-dirs: src/Streamly/Internal/Data/Time
801+ , src
809802 if os(windows)
810803 c-sources: src/Streamly/Internal/Data/Time/Windows.c
811804 if os(darwin)