on master help sign in
Comment out benchmarking code for pipes ops.
commitf8afec67f47ee5fadb9d88120f1665984e063f0d authorPranay Sashank <pranaysashank@gmail.com> dateTue 30 Jul 2019, 15:05 (7 years ago) parentea668dc
2 files changed+20−12
benchmark/Linear.hs+5−5 benchmark/LinearOps.hs+15−7
benchmark/Linear.hs+5−5
@@ -20,7 +20,7 @@ import qualified LinearOps as Ops
2020
2121import Streamly
2222import qualified Streamly.Fold as FL
23−import qualified Streamly.Pipe as Pipe
23+--import qualified Streamly.Pipe as Pipe
2424import qualified Streamly.Mem.Array as A
2525import qualified Streamly.Prelude as S
2626-- import qualified Streamly.Sink as Sink
@@ -242,15 +242,15 @@ main =
242242 , bgroup "folds-transforms"
243243 [ benchIOSink "drain" (FL.foldl' FL.drain)
244244 , benchIOSink "lmap" (FL.foldl' (FL.lmap (+1) FL.drain))
245− , benchIOSink "pipe-mapM"
246− (FL.foldl' (FL.transform (Pipe.mapM (\x -> return $ x + 1)) FL.drain))
245+ {-, benchIOSink "pipe-mapM"
246+ (FL.foldl' (FL.transform (Pipe.mapM (\x -> return $ x + 1)) FL.drain))-}
247247 ]
248248 , bgroup "folds-compositions" -- Applicative
249249 [
250250 benchIOSink "all,any" (FL.foldl' ((,) <$> FL.all (<= Ops.maxValue)
251251 <*> FL.any (> Ops.maxValue)))
252252 , benchIOSink "sum,length" (FL.foldl' ((,) <$> FL.sum <*> FL.length))
253− ]
253+ ] {-
254254 , bgroup "pipes"
255255 [ benchIOSink "mapM" (Ops.transformMapM serially 1)
256256 , benchIOSink "compose" (Ops.transformComposeMapM serially 1)
@@ -262,7 +262,7 @@ main =
262262 , benchIOSink "compose" (Ops.transformComposeMapM serially 4)
263263 , benchIOSink "tee" (Ops.transformTeeMapM serially 4)
264264 , benchIOSink "zip" (Ops.transformZipMapM serially 4)
265− ]
265+ ] -}
266266 , bgroup "transformation"
267267 [ benchIOSink "scanl" (Ops.scan 1)
268268 , benchIOSink "scanl1'" (Ops.scanl1' 1)
benchmark/LinearOps.hs+15−7
@@ -30,7 +30,7 @@ import GHC.Generics (Generic)
3030
3131import qualified Streamly as S hiding (foldMapWith, runStream)
3232import qualified Streamly.Prelude as S
33−import qualified Streamly.Pipe as Pipe
33+-- import qualified Streamly.Pipe as Pipe
3434
3535value, maxValue, value2 :: Int
3636#ifdef LINEAR_ASYNC
@@ -370,14 +370,9 @@ scan, scanl1', map, fmap, mapMaybe, filterEven, filterAllOut,
370370mapMaybeM, intersperse :: S.MonadAsync m => Int -> Stream m Int -> m ()
371371
372372{-# INLINE mapM #-}
373−{-# INLINE transformMapM #-}
374−{-# INLINE transformComposeMapM #-}
375−{-# INLINE transformTeeMapM #-}
376−{-# INLINE transformZipMapM #-}
377373{-# INLINE map' #-}
378374{-# INLINE fmap' #-}
379−mapM, map', transformMapM, transformComposeMapM, transformTeeMapM,
380− transformZipMapM :: (S.IsStream t, S.MonadAsync m)
375+mapM, map' :: (S.IsStream t, S.MonadAsync m)
381376 => (t m Int -> S.SerialT m Int) -> Int -> t m Int -> m ()
382377
383378fmap' :: (S.IsStream t, S.MonadAsync m, P.Functor (t m))
@@ -395,6 +390,18 @@ map n = composeN n $ S.map (+1)
395390map' t n = composeN' n $ t . S.map (+1)
396391mapM t n = composeN' n $ t . S.mapM return
397392
393+-- Temporarily commented these ops as they depend on the hidden
394+-- Pipe module.
395+{-
396+{-# INLINE transformMapM #-}
397+{-# INLINE transformComposeMapM #-}
398+{-# INLINE transformTeeMapM #-}
399+{-# INLINE transformZipMapM #-}
400+
401+transformMapM, transformComposeMapM, transformTeeMapM,
402+ transformZipMapM :: (S.IsStream t, S.MonadAsync m)
403+ => (t m Int -> S.SerialT m Int) -> Int -> t m Int -> m ()
404+
398405transformMapM t n = composeN' n $ t . S.transform (Pipe.mapM return)
399406transformComposeMapM t n = composeN' n $ t . S.transform
400407 (Pipe.mapM (\x -> return (x + 1))
@@ -405,6 +412,7 @@ transformTeeMapM t n = composeN' n $ t . S.transform
405412transformZipMapM t n = composeN' n $ t . S.transform
406413 (Pipe.zipWith (+) (Pipe.mapM (\x -> return (x + 1)))
407414 (Pipe.mapM (\x -> return (x + 2))))
415+-}
408416
409417mapMaybe n = composeN n $ S.mapMaybe
410418 (\x -> if Prelude.odd x then Nothing else Just x)