on master help sign in
Move Benchmark* to benchmark/ + Rm benchmark flag
ea875a0adithyaov
.travis.yml+1−1
@@ -136,7 +136,7 @@ matrix:
136 #- env: BUILD=stack RESOLVER=nightly
136 #- env: BUILD=stack RESOLVER=nightly
137 # addons: {apt: {packages: [cabal-install-1.24], sources: [hvr-ghc]}}
137 # addons: {apt: {packages: [cabal-install-1.24], sources: [hvr-ghc]}}
138
138
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"
140 addons: {apt: {packages: [cabal-install-2.4,libsdl1.2-dev], sources: [hvr-ghc]}}
140 addons: {apt: {packages: [cabal-install-2.4,libsdl1.2-dev], sources: [hvr-ghc]}}
141
141
142 #- env: BUILD=stack RESOLVER=lts-12 GHCVER=8.4
142 #- env: BUILD=stack RESOLVER=lts-12 GHCVER=8.4
benchmark/FileIO.hs+2−2
@@ -14,8 +14,8 @@ import System.Process.Typed (shell, runProcess_)
14import Data.IORef
14import Data.IORef
15import Gauge
15import Gauge
16
16
17−import qualified Streamly.Internal.Benchmark.FileIO.Stream as BFS
17+import qualified Streamly.Benchmark.FileIO.Stream as BFS
18−import qualified Streamly.Internal.Benchmark.FileIO.Array as BFA
18+import qualified Streamly.Benchmark.FileIO.Array as BFA
19
19
20-- Input and output file handles
20-- Input and output file handles
21data Handles = Handles Handle Handle
21data Handles = Handles Handle Handle
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 Streamly.Internal.Benchmark.Prelude as Ops
19+import qualified Streamly.Benchmark.Prelude as Ops
20
20
21import Streamly
21import Streamly
22import qualified Streamly.Data.Fold as FL
22import qualified Streamly.Data.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 Streamly.Internal.Benchmark.Prelude 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 Streamly.Internal.Benchmark.Prelude as Ops
13+import qualified Streamly.Benchmark.Prelude as Ops
14
14
15import Streamly
15import Streamly
16import Gauge
16import Gauge
src/Streamly/Internal/Benchmark/FileIO/Array.hs → benchmark/Streamly/Benchmark/FileIO/Array.hsrenamed+2−2
@@ -1,5 +1,5 @@
1-- |
1-- |
2−-- Module : Streamly.Internal.Benchmark.FileIO.Array
2+-- Module : Streamly.Benchmark.FileIO.Array
3-- Copyright : (c) 2019 Composewell Technologies
3-- Copyright : (c) 2019 Composewell Technologies
4--
4--
5-- License : BSD3
5-- License : BSD3
@@ -18,7 +18,7 @@
18{-# OPTIONS_GHC -fplugin Test.Inspection.Plugin #-}
18{-# OPTIONS_GHC -fplugin Test.Inspection.Plugin #-}
19#endif
19#endif
20
20
21−module Streamly.Internal.Benchmark.FileIO.Array
21+module Streamly.Benchmark.FileIO.Array
22 (
22 (
23 last
23 last
24 , countBytes
24 , countBytes
src/Streamly/Internal/Benchmark/FileIO/Stream.hs → benchmark/Streamly/Benchmark/FileIO/Stream.hsrenamed+2−2
@@ -1,5 +1,5 @@
1-- |
1-- |
2−-- Module : Streamly.Internal.Benchmark.FileIO.Stream
2+-- Module : Streamly.Benchmark.FileIO.Stream
3-- Copyright : (c) 2019 Composewell Technologies
3-- Copyright : (c) 2019 Composewell Technologies
4--
4--
5-- License : BSD3
5-- License : BSD3
@@ -19,7 +19,7 @@
19{-# OPTIONS_GHC -fplugin Test.Inspection.Plugin #-}
19{-# OPTIONS_GHC -fplugin Test.Inspection.Plugin #-}
20#endif
20#endif
21
21
22−module Streamly.Internal.Benchmark.FileIO.Stream
22+module Streamly.Benchmark.FileIO.Stream
23 (
23 (
24 -- * FileIO
24 -- * FileIO
25 last
25 last
src/Streamly/Internal/Benchmark/Prelude.hs → benchmark/Streamly/Benchmark/Prelude.hsrenamed+2−2
@@ -1,5 +1,5 @@
1-- |
1-- |
2−-- Module : Streamly.Internal.Benchmark.Prelude
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
@@ -20,7 +20,7 @@
20{-# OPTIONS_GHC -fplugin Test.Inspection.Plugin #-}
20{-# OPTIONS_GHC -fplugin Test.Inspection.Plugin #-}
21#endif
21#endif
22
22
23−module Streamly.Internal.Benchmark.Prelude where
23+module Streamly.Benchmark.Prelude where
24
24
25import Control.DeepSeq (NFData)
25import Control.DeepSeq (NFData)
26import Control.Monad (when)
26import Control.Monad (when)
cabal.project.ci+1−2
@@ -3,5 +3,4 @@ packages:
3
3
4package streamly
4package streamly
5 ghc-options: -Werror
5 ghc-options: -Werror
6− flags: benchmark
7− inspection
6+ flags: inspection
streamly.cabal+56−63
@@ -134,11 +134,6 @@ source-repository head
134 type: git
134 type: git
135 location: https://github.com/composewell/streamly
135 location: https://github.com/composewell/streamly
136
136
137−flag benchmark
138− description: Benchmark build
139− manual: True
140− default: False
141−
142flag inspection
137flag inspection
143 description: Enable inspection testing
138 description: Enable inspection testing
144 manual: True
139 manual: True
@@ -257,6 +252,7 @@ common exe-options
257common bench-options
252common bench-options
258 import: compile-options, optimization-options
253 import: compile-options, optimization-options
259 ghc-options: -with-rtsopts "-T"
254 ghc-options: -with-rtsopts "-T"
255+ build-depends: mtl >= 2.2 && < 3
260
256
261-------------------------------------------------------------------------------
257-------------------------------------------------------------------------------
262-- Library
258-- Library
@@ -354,12 +350,6 @@ library
354 , Streamly.Internal.Network.Socket
350 , Streamly.Internal.Network.Socket
355 , Streamly.Internal.Network.Inet.TCP
351 , Streamly.Internal.Network.Inet.TCP
356
352
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−
363 build-depends: base >= 4.8 && < 5
353 build-depends: base >= 4.8 && < 5
364 , ghc-prim >= 0.2 && < 0.6
354 , ghc-prim >= 0.2 && < 0.6
365 , deepseq >= 1.4.1 && < 1.5
355 , deepseq >= 1.4.1 && < 1.5
@@ -379,10 +369,6 @@ library
379 , transformers >= 0.4 && < 0.6
369 , transformers >= 0.4 && < 0.6
380 , transformers-base >= 0.4 && < 0.5
370 , transformers-base >= 0.4 && < 0.5
381
371
382− if flag(inspection)
383− build-depends: template-haskell >= 2.14 && < 2.16
384− , inspection-testing >= 0.4 && < 0.5
385−
386 if !impl(ghcjs)
372 if !impl(ghcjs)
387 build-depends:
373 build-depends:
388 network >= 2.6 && < 4
374 network >= 2.6 && < 4
@@ -571,61 +557,64 @@ test-suite parallel-loops
571
557
572benchmark linear
558benchmark linear
573 import: bench-options
559 import: bench-options
560+ other-modules: Streamly.Benchmark.Prelude
574 type: exitcode-stdio-1.0
561 type: exitcode-stdio-1.0
575 hs-source-dirs: benchmark
562 hs-source-dirs: benchmark
576 main-is: Linear.hs
563 main-is: Linear.hs
577− if flag(benchmark)
564+ buildable: True
578− 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)
579 build-depends:
572 build-depends:
580− streamly
573+ transformers >= 0.4 && < 0.6
581− , base >= 4.8 && < 5
574+ if flag(inspection)
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:
575+ build-depends: template-haskell >= 2.14 && < 2.16
587− transformers >= 0.4 && < 0.6
576+ , inspection-testing >= 0.4 && < 0.5
588− else
589− buildable: False
590
577
591benchmark linear-async
578benchmark linear-async
592 import: bench-options
579 import: bench-options
580+ other-modules: Streamly.Benchmark.Prelude
593 cpp-options: -DLINEAR_ASYNC
581 cpp-options: -DLINEAR_ASYNC
594 type: exitcode-stdio-1.0
582 type: exitcode-stdio-1.0
595 hs-source-dirs: benchmark
583 hs-source-dirs: benchmark
596 main-is: LinearAsync.hs
584 main-is: LinearAsync.hs
597− if flag(benchmark)
585+ buildable: True
598− 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)
599 build-depends:
593 build-depends:
600− streamly
594+ transformers >= 0.4 && < 0.6
601− , base >= 4.8 && < 5
595+ if flag(inspection)
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:
596+ build-depends: template-haskell >= 2.14 && < 2.16
607− transformers >= 0.4 && < 0.6
597+ , inspection-testing >= 0.4 && < 0.5
608− else
609− buildable: False
610
598
611benchmark linear-rate
599benchmark linear-rate
612 import: bench-options
600 import: bench-options
601+ other-modules: Streamly.Benchmark.Prelude
613 type: exitcode-stdio-1.0
602 type: exitcode-stdio-1.0
614 hs-source-dirs: benchmark
603 hs-source-dirs: benchmark
615 main-is: LinearRate.hs
604 main-is: LinearRate.hs
616− if flag(benchmark)
605+ buildable: True
617− 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)
618 build-depends:
613 build-depends:
619− streamly
614+ transformers >= 0.4 && < 0.6
620− , base >= 4.8 && < 5
615+ if flag(inspection)
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:
616+ build-depends: template-haskell >= 2.14 && < 2.16
626− transformers >= 0.4 && < 0.6
617+ , inspection-testing >= 0.4 && < 0.5
627− else
628− buildable: False
629
618
630benchmark nested
619benchmark nested
631 import: bench-options
620 import: bench-options
@@ -709,22 +698,24 @@ benchmark array
709
698
710benchmark fileio
699benchmark fileio
711 import: bench-options
700 import: bench-options
701+ other-modules: Streamly.Benchmark.FileIO.Array
702+ , Streamly.Benchmark.FileIO.Stream
712 type: exitcode-stdio-1.0
703 type: exitcode-stdio-1.0
713 -- A value of 400 works better for some benchmarks, however, it takes
704 -- A value of 400 works better for some benchmarks, however, it takes
714 -- extraordinary amount of time to compile with that.
705 -- extraordinary amount of time to compile with that.
715 -- ghc-options: -funfolding-use-threshold=150
706 -- ghc-options: -funfolding-use-threshold=150
716 hs-source-dirs: benchmark
707 hs-source-dirs: benchmark
717 main-is: FileIO.hs
708 main-is: FileIO.hs
718− if flag(benchmark)
719− buildable: True
709+ buildable: True
720− build-depends:
710+ build-depends:
721− streamly
711+ streamly
722− , base >= 4.8 && < 5
712+ , base >= 4.8 && < 5
723− , gauge >= 0.2.4 && < 0.3
713+ , gauge >= 0.2.4 && < 0.3
724− , typed-process >= 0.2.3 && < 0.3
714+ , typed-process >= 0.2.3 && < 0.3
725− , deepseq >= 1.4.1 && < 1.5
715+ , deepseq >= 1.4.1 && < 1.5
726− else
716+ if flag(inspection)
727− buildable: False
717+ build-depends: template-haskell >= 2.14 && < 2.16
718+ , inspection-testing >= 0.4 && < 0.5
728
719
729benchmark concurrent
720benchmark concurrent
730 import: bench-options
721 import: bench-options
@@ -750,7 +741,8 @@ benchmark concurrent
750benchmark base
741benchmark base
751 import: bench-options
742 import: bench-options
752 type: exitcode-stdio-1.0
743 type: exitcode-stdio-1.0
753− include-dirs: src/Streamly/Internal/Data/Time
744+ include-dirs: src/Streamly/Internal/Data/Time
745+ src
754 if os(windows)
746 if os(windows)
755 c-sources: src/Streamly/Internal/Data/Time/Windows.c
747 c-sources: src/Streamly/Internal/Data/Time/Windows.c
756 if os(darwin)
748 if os(darwin)
@@ -805,7 +797,8 @@ benchmark base
805executable nano-bench
797executable nano-bench
806 import: bench-options
798 import: bench-options
807 hs-source-dirs: benchmark, src
799 hs-source-dirs: benchmark, src
808− include-dirs: src/Streamly/Internal/Data/Time
800+ include-dirs: src/Streamly/Internal/Data/Time
801+ , src
809 if os(windows)
802 if os(windows)
810 c-sources: src/Streamly/Internal/Data/Time/Windows.c
803 c-sources: src/Streamly/Internal/Data/Time/Windows.c
811 if os(darwin)
804 if os(darwin)