@@ -7,12 +7,7 @@
8{-# LANGUAGE FlexibleContexts #-}
8{-# LANGUAGE FlexibleContexts #-}
10−module Streamly.Benchmark.Data.Fold
11− ( o_1_space_serial_folds
12− , o_1_space_serial_foldsTransforms
13− , o_1_space_serial_foldsCompositions
14− , o_n_heap_serial_folds
15− ) where
10+module Main (main) where
17import Control.DeepSeq (NFData(..))
12import Control.DeepSeq (NFData(..))
18import Data.Monoid (Last(..))
13import Data.Monoid (Last(..))
@@ -20,7 +15,7 @@ import Data.Monoid (Last(..))
20import System.Random (randomRIO)
15import System.Random (randomRIO)
21import Prelude (IO, Int, Double, String, (>), (<*>), (<$>), (+), ($),
16import Prelude (IO, Int, Double, String, (>), (<*>), (<$>), (+), ($),
22 (<=), Monad(..), (==), Maybe(..), (.), fromIntegral,
17 (<=), Monad(..), (==), Maybe(..), (.), fromIntegral,
23− compare, (>=))
18+ compare, (>=), concat, seq)
25import qualified Streamly as S hiding (runStream)
20import qualified Streamly as S hiding (runStream)
26import qualified Streamly.Prelude as S
21import qualified Streamly.Prelude as S
@@ -36,6 +31,7 @@ import qualified Streamly.Internal.Prelude as IP
37import Gauge
32import Gauge
38import Streamly hiding (runStream)
33import Streamly hiding (runStream)
34+import Streamly.Benchmark.Common
40-- We need a monadic bind here to make sure that the function f does not get
36-- We need a monadic bind here to make sure that the function f does not get
41-- completely optimized out by the compiler in some cases.
37-- completely optimized out by the compiler in some cases.
@@ -208,3 +204,27 @@ o_n_heap_serial_folds value =
208+-------------------------------------------------------------------------------
210+-------------------------------------------------------------------------------
214+ (value, cfg, benches) <- parseCLIOpts defaultStreamSize
215+ value `seq` runMode (mode cfg) cfg benches (allBenchmarks value)
217+ allBenchmarks value =
222+ [ o_1_space_serial_folds value
223+ , o_1_space_serial_foldsTransforms value
224+ , o_1_space_serial_foldsCompositions value
229+ [bgroup "fold" $ concat [o_n_heap_serial_folds value]]