@@ -16,9 +16,9 @@ import Streamly.Internal.Data.Unfold (Unfold)
16import qualified Prelude
16import qualified Prelude
17import qualified Streamly.Internal.Data.Fold as FL
17import qualified Streamly.Internal.Data.Fold as FL
18import qualified Streamly.Internal.Data.Unfold as UF
18import qualified Streamly.Internal.Data.Unfold as UF
19+import qualified Streamly.Benchmark.Data.NestedUnfoldOps as Nested
20import Streamly.Benchmark.Common
21import Streamly.Benchmark.Common
21−import Streamly.Benchmark.Data.NestedUnfoldOps
22import Gauge
22import Gauge
23import Prelude hiding (concat, take)
23import Prelude hiding (concat, take)
@@ -160,8 +160,8 @@ zipWithM size start =
160moduleName :: String
160moduleName :: String
161moduleName = "Data.Unfold"
161moduleName = "Data.Unfold"
163−o_1_space_serial_generation :: Int -> [Benchmark]
163+o_1_space_generation :: Int -> [Benchmark]
164−o_1_space_serial_generation size =
164+o_1_space_generation size =
165 [ bgroup "generation"
165 [ bgroup "generation"
166 [ benchIO "fromListM" $ fromListM size
166 [ benchIO "fromListM" $ fromListM size
167 , benchIO "replicateM" $ replicateM size
167 , benchIO "replicateM" $ replicateM size
@@ -171,14 +171,11 @@ o_1_space_serial_generation size =
174−o_1_space_serial_transformation :: Int -> [Benchmark]
174+o_1_space_transformation :: Int -> [Benchmark]
175−o_1_space_serial_transformation size =
175+o_1_space_transformation size =
176 [ bgroup "transformation"
176 [ bgroup "transformation"
177 [ benchIO "take" $ take size
177 [ benchIO "take" $ take size
178 , benchIO "takeWhileM" $ takeWhileM size
178 , benchIO "takeWhileM" $ takeWhileM size
179− , benchIO "filterAllOut" $ filterAllOut size
180− , benchIO "filterAllIn" $ filterAllIn size
181− , benchIO "filterSome" $ filterSome size
182 -- This will take nanoseconds, We need to fix the benchmark reporting to
179 -- This will take nanoseconds, We need to fix the benchmark reporting to
183 -- have microseconds as the minimum unit before uncommenting this.
180 -- have microseconds as the minimum unit before uncommenting this.
184 -- , benchIO "dropOne" $ dropOne size
181 -- , benchIO "dropOne" $ dropOne size
@@ -188,28 +185,31 @@ o_1_space_serial_transformation size =
191−o_1_space_serial_combination :: Int -> [Benchmark]
188+o_1_space_combination :: Int -> [Benchmark]
192−o_1_space_serial_combination size =
189+o_1_space_combination size =
193 [ bgroup "combination"
190 [ bgroup "combination"
194 [ benchIO "zipWithM" $ zipWithM size
191 [ benchIO "zipWithM" $ zipWithM size
198−o_1_space_serial_outerProduct :: Int -> [Benchmark]
195+o_1_space_nested :: Int -> [Benchmark]
199−o_1_space_serial_outerProduct size =
196+o_1_space_nested size =
200 [ bgroup "outer-product"
197 [ bgroup "outer-product"
201− [ benchIO "toNull" $ toNull size
198+ [ benchIO "toNull" $ Nested.toNull size
202− , benchIO "toNull3" $ toNull3 size
199+ , benchIO "toNull3" $ Nested.toNull3 size
203− , benchIO "concat" $ concat size
200+ , benchIO "concat" $ Nested.concat size
204− , benchIO "breakAfterSome" $ breakAfterSome size
201+ , benchIO "breakAfterSome" $ Nested.breakAfterSome size
202+ , benchIO "filterAllOut" $ Nested.filterAllOut size
203+ , benchIO "filterAllIn" $ Nested.filterAllIn size
204+ , benchIO "filterSome" $ Nested.filterSome size
208−o_n_space_serial :: Int -> [Benchmark]
208+o_n_space_nested :: Int -> [Benchmark]
209−o_n_space_serial size =
209+o_n_space_nested size =
210 [ bgroup "outer-product"
210 [ bgroup "outer-product"
211− [ benchIO "toList" $ toList size
211+ [ benchIO "toList" $ Nested.toList size
212− , benchIO "toListSome" $ toListSome size
212+ , benchIO "toListSome" $ Nested.toListSome size
@@ -227,11 +227,11 @@ main = do
227 allBenchmarks size =
227 allBenchmarks size =
228 [ bgroup (o_1_space_prefix moduleName)
228 [ bgroup (o_1_space_prefix moduleName)
229 $ Prelude.concat
229 $ Prelude.concat
230− [ o_1_space_serial_generation size
230+ [ o_1_space_generation size
231− , o_1_space_serial_transformation size
231+ , o_1_space_transformation size
232− , o_1_space_serial_combination size
232+ , o_1_space_combination size
233− , o_1_space_serial_outerProduct size
233+ , o_1_space_nested size
235 , bgroup (o_n_space_prefix moduleName)
235 , bgroup (o_n_space_prefix moduleName)
236− $ Prelude.concat [o_n_space_serial size]
236+ $ Prelude.concat [o_n_space_nested size]