on master help sign in
Add a zipAsync traverse benchmark
commitf51025b4c5920a66627fe3db9fe0b53731979497 authoradithyaov <adithya@composewell.com> dateThu 9 Dec 2021, 00:24 (5 years ago) parent4210138
1 file changed+7
benchmark/Streamly/Benchmark/Prelude/ZipAsync.hs+7
benchmark/Streamly/Benchmark/Prelude/ZipAsync.hs+7
@@ -41,6 +41,12 @@ zipAsyncAp count n =
4141 S.fromZipAsync $
4242 (,) <$> sourceUnfoldrM count n <*> sourceUnfoldrM count (n + 1)
4343
44+fromZipAsyncTraverse :: String -> Int -> Benchmark
45+fromZipAsyncTraverse name count =
46+ bench name
47+ $ nfIO
48+ $ S.drain $ S.fromZipAsync $ traverse S.fromPure [0 :: Int .. count]
49+
4450o_1_space_joining :: Int -> [Benchmark]
4551o_1_space_joining value =
4652 [ bgroup "joining"
@@ -50,6 +56,7 @@ o_1_space_joining value =
5056 (value `div` 2))
5157 , benchIOSrc fromSerial "zipAsyncAp (2,x/2)" (zipAsyncAp (value `div` 2))
5258 , benchIOSink value "fmap zipAsyncly" $ fmapN S.fromZipAsync 1
59+ , fromZipAsyncTraverse "ZipAsync Applicative (x/100)" (value `div` 100)
5360 ]
5461 ]
5562