on master help sign in
Add a zipAsync traverse benchmark
f51025badithyaov
benchmark/Streamly/Benchmark/Prelude/ZipAsync.hs+7
@@ -41,6 +41,12 @@ zipAsyncAp count n =
41 S.fromZipAsync $
41 S.fromZipAsync $
42 (,) <$> sourceUnfoldrM count n <*> sourceUnfoldrM count (n + 1)
42 (,) <$> sourceUnfoldrM count n <*> sourceUnfoldrM count (n + 1)
43
43
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+
44o_1_space_joining :: Int -> [Benchmark]
50o_1_space_joining :: Int -> [Benchmark]
45o_1_space_joining value =
51o_1_space_joining value =
46 [ bgroup "joining"
52 [ bgroup "joining"
@@ -50,6 +56,7 @@ o_1_space_joining value =
50 (value `div` 2))
56 (value `div` 2))
51 , benchIOSrc fromSerial "zipAsyncAp (2,x/2)" (zipAsyncAp (value `div` 2))
57 , benchIOSrc fromSerial "zipAsyncAp (2,x/2)" (zipAsyncAp (value `div` 2))
52 , benchIOSink value "fmap zipAsyncly" $ fmapN S.fromZipAsync 1
58 , benchIOSink value "fmap zipAsyncly" $ fmapN S.fromZipAsync 1
59+ , fromZipAsyncTraverse "ZipAsync Applicative (x/100)" (value `div` 100)
53 ]
60 ]
54 ]
61 ]
55
62