on master help sign in
Add large stream benchmarks for linear/nested-concurrent
commit5949f4c15da4cfdf86b16aba0d97a9418c969052 authorHarendra Kumar <harendra.kumar@gmail.com> dateThu 26 Dec 2019, 10:15 (7 years ago) parent17a3005
2 files changed+43−2
benchmark/NestedOps.hs+6−2 streamly.cabal+37
benchmark/NestedOps.hs+6−2
@@ -5,6 +5,7 @@
55-- License : MIT
66-- Maintainer : streamly@composewell.com
77
8+{-# LANGUAGE CPP #-}
89{-# LANGUAGE FlexibleContexts #-}
910{-# LANGUAGE ScopedTypeVariables #-}
1011
@@ -17,12 +18,15 @@ import qualified Streamly as S hiding (runStream)
1718import qualified Streamly.Prelude as S
1819
1920linearCount :: Int
21+#ifdef LONG_BENCHMARKS
22+linearCount = 10000000
23+#else
2024linearCount = 100000
25+#endif
2126
2227-- double nested loop
2328nestedCount2 :: Int
24−-- nestedCount2 = round (fromIntegral linearCount**(1/2::Double))
25−nestedCount2 = 100
29+nestedCount2 = round (fromIntegral linearCount**(1/2::Double))
2630
2731-- triple nested loop
2832nestedCount3 :: Int
streamly.cabal+37
@@ -586,6 +586,26 @@ benchmark linear
586586 build-depends: template-haskell >= 2.14 && < 2.16
587587 , inspection-testing >= 0.4 && < 0.5
588588
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+
589609benchmark nested
590610 import: bench-options
591611 type: exitcode-stdio-1.0
@@ -750,6 +770,23 @@ benchmark nested-concurrent
750770 build-depends:
751771 transformers >= 0.4 && < 0.6
752772
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+
753790benchmark linear-rate
754791 import: bench-options-threaded
755792 type: exitcode-stdio-1.0