@@ -8,7 +8,6 @@
88
99module Stream.AsyncCommon
1010 ( allBenchmarks
11− , interleaveBenchmarks
1211 )
1312where
1413
@@ -80,19 +79,11 @@ concatAsync2 f count n =
8079 $ Stream.fromList
8180 [sourceUnfoldrM count n, sourceUnfoldrM count (n + 1)]
8281
83−{-# INLINE interleave2 #-}
84−interleave2 :: (Config -> Config) -> Int -> Int -> IO ()
85−interleave2 f count n =
86− Stream.fold Fold.drain
87− $ Async.combineWith (f . Async.interleaved)
88− (sourceUnfoldrM count n) (sourceUnfoldrM count (n + 1))
89−
9082o_1_space_joining :: Int -> (Config -> Config) -> [Benchmark]
9183o_1_space_joining value f =
9284 [ bgroup "joining"
9385 [ benchIOSrc1 "async (2 of n/2)" (async2 f (value `div` 2))
9486 , benchIOSrc1 "concat async (2 of n/2)" (concatAsync2 f (value `div` 2))
95− , benchIOSrc1 "interleave (2 of n/2)" (interleave2 f (value `div` 2))
9687 ]
9788 ]
9889
@@ -156,18 +147,6 @@ concatFmapStreamsWith f outer inner n =
156147 $ Async.concatWith f
157148 $ fmap (sourceUnfoldrM inner) (sourceUnfoldrM outer n)
158149
159−{-# INLINE concatMapInterleaveStreamsWith #-}
160−concatMapInterleaveStreamsWith
161− :: (Config -> Config)
162− -> Int
163− -> Int
164− -> Int
165− -> IO ()
166−concatMapInterleaveStreamsWith f outer inner n =
167− Stream.fold Fold.drain
168− $ Async.concatMapWith (f . Async.interleaved)
169− (sourceUnfoldrM inner) (sourceUnfoldrM outer n)
170−
171150o_1_space_concatMap :: Int -> (Config -> Config) -> [Benchmark]
172151o_1_space_concatMap value f =
173152 value2 `seq`
@@ -187,24 +166,6 @@ o_1_space_concatMap value f =
187166
188167 value2 = round $ sqrt (fromIntegral value :: Double)
189168
190−-- XXX These do not work with the eager option
191−o_1_space_concatMapInterleave :: Int -> (Config -> Config) -> [Benchmark]
192−o_1_space_concatMapInterleave value f =
193− value2 `seq`
194− [ bgroup "concat"
195− [ benchIO "concatMapInterleaveWith (n of 1)"
196− (concatMapInterleaveStreamsWith f value 1)
197− , benchIO "concatMapInterleaveWith (sqrt x of sqrt x)"
198− (concatMapInterleaveStreamsWith f value2 value2)
199− , benchIO "concatMapInterleaveWith (1 of n)"
200− (concatMapInterleaveStreamsWith f 1 value)
201− ]
202− ]
203−
204− where
205−
206− value2 = round $ sqrt (fromIntegral value :: Double)
207−
208169-------------------------------------------------------------------------------
209170-- Monadic outer product
210171-------------------------------------------------------------------------------
@@ -244,10 +205,3 @@ allBenchmarks moduleName modifier value =
244205 , bgroup (o_n_heap_prefix moduleName)
245206 (o_n_heap_buffering value modifier)
246207 ]
247−
248−interleaveBenchmarks :: String -> (Config -> Config) -> Int -> [Benchmark]
249−interleaveBenchmarks moduleName modifier value =
250− [ bgroup
251− (o_1_space_prefix moduleName)
252− (o_1_space_concatMapInterleave value modifier)
253− ]