on master help sign in
Move stream filtering into a seperate group in unfold benchmarks
commitd3f290b7b33be9efb586361362d36605af83deb0 authoradithyaov <adithya@composewell.com> dateFri 23 Oct 2020, 09:59 (6 years ago) parentb5da56a
1 file changed+13−1
benchmark/Streamly/Benchmark/Data/Unfold.hs+13−1
benchmark/Streamly/Benchmark/Data/Unfold.hs+13−1
@@ -277,6 +277,10 @@ mapMWithInput size start =
277277 (UF.mapMWithInput (\a b -> return $ a + b))
278278 start
279279
280+-------------------------------------------------------------------------------
281+-- Stream filtering
282+-------------------------------------------------------------------------------
283+
280284{-# INLINE takeWhileM #-}
281285takeWhileM :: Monad m => Int -> Int -> m ()
282286takeWhileM size start =
@@ -462,7 +466,14 @@ o_1_space_transformation size =
462466 [ benchIO "map" $ map size
463467 , benchIO "mapM" $ mapM size
464468 , benchIO "mapMWithInput" $ mapMWithInput size
465− , benchIO "takeWhileM" $ takeWhileM size
469+ ]
470+ ]
471+
472+o_1_space_filtering :: Int -> [Benchmark]
473+o_1_space_filtering size =
474+ [ bgroup
475+ "filtering"
476+ [ benchIO "takeWhileM" $ takeWhileM size
466477 , benchIO "takeWhile" $ takeWhile size
467478 , benchIO "take" $ take size
468479 , benchIO "filter" $ filter size
@@ -532,6 +543,7 @@ main = do
532543 [ o_1_space_transformation_input size
533544 , o_1_space_generation size
534545 , o_1_space_transformation size
546+ , o_1_space_filtering size
535547 , o_1_space_zip size
536548 , o_1_space_nested size
537549 ]