on master help sign in
Add large stream benchmarks for linear/nested-concurrent
5949f4cHarendra Kumar
benchmark/NestedOps.hs+6−2
@@ -5,6 +5,7 @@
5-- License : MIT
5-- License : MIT
6-- Maintainer : streamly@composewell.com
6-- Maintainer : streamly@composewell.com
7
7
8+{-# LANGUAGE CPP #-}
8{-# LANGUAGE FlexibleContexts #-}
9{-# LANGUAGE FlexibleContexts #-}
9{-# LANGUAGE ScopedTypeVariables #-}
10{-# LANGUAGE ScopedTypeVariables #-}
10
11
@@ -17,12 +18,15 @@ import qualified Streamly as S hiding (runStream)
17import qualified Streamly.Prelude as S
18import qualified Streamly.Prelude as S
18
19
19linearCount :: Int
20linearCount :: Int
21+#ifdef LONG_BENCHMARKS
22+linearCount = 10000000
23+#else
20linearCount = 100000
24linearCount = 100000
25+#endif
21
26
22-- double nested loop
27-- double nested loop
23nestedCount2 :: Int
28nestedCount2 :: Int
24−-- nestedCount2 = round (fromIntegral linearCount**(1/2::Double))
29+nestedCount2 = round (fromIntegral linearCount**(1/2::Double))
25−nestedCount2 = 100
26
30
27-- triple nested loop
31-- triple nested loop
28nestedCount3 :: Int
32nestedCount3 :: Int
streamly.cabal+37
@@ -586,6 +586,26 @@ benchmark linear
586 build-depends: template-haskell >= 2.14 && < 2.16
586 build-depends: template-haskell >= 2.14 && < 2.16
587 , inspection-testing >= 0.4 && < 0.5
587 , inspection-testing >= 0.4 && < 0.5
588
588
589+benchmark linear-long
590+ import: bench-options-threaded
591+ type: exitcode-stdio-1.0
592+ cpp-options: -DLONG_BENCHMARKS
593+ hs-source-dirs: benchmark
594+ main-is: Linear.hs
595+ other-modules: Streamly.Benchmark.Prelude
596+ build-depends:
597+ streamly
598+ , base >= 4.8 && < 5
599+ , deepseq >= 1.4.1 && < 1.5
600+ , random >= 1.0 && < 2.0
601+ , gauge >= 0.2.4 && < 0.3
602+ if impl(ghc < 8.0)
603+ build-depends:
604+ transformers >= 0.4 && < 0.6
605+ if flag(inspection)
606+ build-depends: template-haskell >= 2.14 && < 2.16
607+ , inspection-testing >= 0.4 && < 0.5
608+
589benchmark nested
609benchmark nested
590 import: bench-options
610 import: bench-options
591 type: exitcode-stdio-1.0
611 type: exitcode-stdio-1.0
@@ -750,6 +770,23 @@ benchmark nested-concurrent
750 build-depends:
770 build-depends:
751 transformers >= 0.4 && < 0.6
771 transformers >= 0.4 && < 0.6
752
772
773+benchmark nested-concurrent-long
774+ import: bench-options-threaded
775+ cpp-options: -DLONG_BENCHMARKS
776+ type: exitcode-stdio-1.0
777+ hs-source-dirs: benchmark
778+ main-is: NestedConcurrent.hs
779+ other-modules: NestedOps
780+ build-depends:
781+ streamly
782+ , base >= 4.8 && < 5
783+ , deepseq >= 1.4.1 && < 1.5
784+ , random >= 1.0 && < 2.0
785+ , gauge >= 0.2.4 && < 0.3
786+ if impl(ghc < 8.0)
787+ build-depends:
788+ transformers >= 0.4 && < 0.6
789+
753benchmark linear-rate
790benchmark linear-rate
754 import: bench-options-threaded
791 import: bench-options-threaded
755 type: exitcode-stdio-1.0
792 type: exitcode-stdio-1.0