@@ -215,7 +215,7 @@ o_1_space_reduce_toBytes env =
216chunksOfSum :: Int -> Handle -> IO Int
216chunksOfSum :: Int -> Handle -> IO Int
217chunksOfSum n inh =
217chunksOfSum n inh =
218− S.fold Fold.length $ IP.chunksOf n FL.sum (S.unfold FH.reader inh)
218+ S.fold Fold.length $ IP.groupsOf n FL.sum (S.unfold FH.reader inh)
220foldManyPostChunksOfSum :: Int -> Handle -> IO Int
220foldManyPostChunksOfSum :: Int -> Handle -> IO Int
221foldManyPostChunksOfSum n inh =
221foldManyPostChunksOfSum n inh =
@@ -231,20 +231,20 @@ foldManyChunksOfSum n inh =
231-- Even though allocations remain the same in both cases inlining improves time
231-- Even though allocations remain the same in both cases inlining improves time
233-- | Slice in chunks of size n and get the count of chunks.
233-- | Slice in chunks of size n and get the count of chunks.
234−{-# INLINE chunksOf #-}
234+{-# INLINE groupsOf #-}
235−chunksOf :: Int -> Handle -> IO Int
235+groupsOf :: Int -> Handle -> IO Int
236−chunksOf n inh =
236+groupsOf n inh =
237 -- writeNUnsafe gives 2.5x boost here over writeN.
237 -- writeNUnsafe gives 2.5x boost here over writeN.
238 S.fold Fold.length
238 S.fold Fold.length
239− $ IP.chunksOf n (AT.writeNUnsafe n) (S.unfold FH.reader inh)
239+ $ IP.groupsOf n (AT.writeNUnsafe n) (S.unfold FH.reader inh)
241#ifdef INSPECTION
241#ifdef INSPECTION
242−inspect $ hasNoTypeClasses 'chunksOf
242+inspect $ hasNoTypeClasses 'groupsOf
243−inspect $ 'chunksOf `hasNoType` ''Step
243+inspect $ 'groupsOf `hasNoType` ''Step
244−inspect $ 'chunksOf `hasNoType` ''FoldMany
244+inspect $ 'groupsOf `hasNoType` ''FoldMany
245−inspect $ 'chunksOf `hasNoType` ''AT.ArrayUnsafe -- AT.writeNUnsafe
245+inspect $ 'groupsOf `hasNoType` ''AT.ArrayUnsafe -- AT.writeNUnsafe
246 -- FH.read/A.read
246 -- FH.read/A.read
247−inspect $ 'chunksOf `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
247+inspect $ 'groupsOf `hasNoType` ''IUF.ConcatState -- FH.read/UF.many
250{-# INLINE arraysOf #-}
250{-# INLINE arraysOf #-}
@@ -255,10 +255,10 @@ arraysOf n inh =
255o_1_space_reduce_read_grouped :: BenchEnv -> [Benchmark]
255o_1_space_reduce_read_grouped :: BenchEnv -> [Benchmark]
256o_1_space_reduce_read_grouped env =
256o_1_space_reduce_read_grouped env =
257 [ bgroup "reduce/read/chunks"
257 [ bgroup "reduce/read/chunks"
258− [ mkBench ("S.chunksOf " ++ show (bigSize env) ++ " FL.sum") env $
258+ [ mkBench ("S.groupsOf " ++ show (bigSize env) ++ " FL.sum") env $
259 \inh _ ->
259 \inh _ ->
260 chunksOfSum (bigSize env) inh
260 chunksOfSum (bigSize env) inh
261− , mkBench "S.chunksOf 1 FL.sum" env $ \inh _ ->
261+ , mkBench "S.groupsOf 1 FL.sum" env $ \inh _ ->
262 chunksOfSum 1 inh
262 chunksOfSum 1 inh
264 -- XXX investigate why we need inline/noinline in these cases (GHC)
264 -- XXX investigate why we need inline/noinline in these cases (GHC)
@@ -281,14 +281,14 @@ o_1_space_reduce_read_grouped env =
281 $ \inh _ -> inline foldManyChunksOfSum 1 inh
281 $ \inh _ -> inline foldManyChunksOfSum 1 inh
283 -- folding chunks to arrays
283 -- folding chunks to arrays
284− , mkBenchSmall "S.chunksOf 1" env $ \inh _ ->
284+ , mkBenchSmall "S.groupsOf 1" env $ \inh _ ->
285− chunksOf 1 inh
285+ groupsOf 1 inh
286− , mkBench "S.chunksOf 10" env $ \inh _ ->
286+ , mkBench "S.groupsOf 10" env $ \inh _ ->
287− chunksOf 10 inh
287+ groupsOf 10 inh
288− , mkBench "S.chunksOf 1000" env $ \inh _ ->
288+ , mkBench "S.groupsOf 1000" env $ \inh _ ->
289− chunksOf 1000 inh
289+ groupsOf 1000 inh
291− -- arraysOf may use a different impl than chunksOf
291+ -- arraysOf may use a different impl than groupsOf
292 , mkBenchSmall "S.arraysOf 1" env $ \inh _ ->
292 , mkBenchSmall "S.arraysOf 1" env $ \inh _ ->
293 arraysOf 1 inh
293 arraysOf 1 inh
294 , mkBench "S.arraysOf 10" env $ \inh _ ->
294 , mkBench "S.arraysOf 10" env $ \inh _ ->