@@ -10,6 +10,7 @@ import Data.Functor.Identity (Identity, runIdentity)
1010import System.Random (randomRIO)
1111import qualified LinearOps as Ops
1212
13+import Streamly
1314import Gauge
1415
1516-- We need a monadic bind here to make sure that the function f does not get
@@ -17,6 +18,9 @@ import Gauge
1718benchIO :: (NFData b) => String -> (Ops.Stream m Int -> IO b) -> Benchmark
1819benchIO name f = bench name $ nfIO $ randomRIO (1,1000) >>= f . Ops.source
1920
21+benchIOAppend :: (NFData b) => String -> (Int -> IO b) -> Benchmark
22+benchIOAppend name f = bench name $ nfIO $ randomRIO (1,1000) >>= f
23+
2024_benchId :: (NFData b) => String -> (Ops.Stream m Int -> Identity b) -> Benchmark
2125_benchId name f = bench name $ nf (runIdentity . f) (Ops.source 10)
2226
@@ -45,6 +49,12 @@ main = do
4549 , benchIO "dropWhile-true" Ops.dropWhileTrue
4650 ]
4751 , benchIO "zip" Ops.zip
52+ , bgroup "append"
53+ [ benchIOAppend "streamly" $ Ops.append streamly
54+ , benchIOAppend "costreamly" $ Ops.append costreamly
55+ , benchIOAppend "coparallely" $ Ops.append coparallely
56+ , benchIOAppend "parallely" $ Ops.append parallely
57+ ]
4858 , bgroup "compose"
4959 [ benchIO "mapM" Ops.composeMapM
5060 , benchIO "map-with-all-in-filter" Ops.composeMapAllInFilter