@@ -192,6 +192,23 @@ spanByRolling :: MonadThrow m => Int -> SerialT m Int -> m ((), ())
192spanByRolling value =
192spanByRolling value =
193 IP.parseD (PR.spanByRolling (\_ i -> i <= value `div` 2) FL.drain FL.drain)
193 IP.parseD (PR.spanByRolling (\_ i -> i <= value `div` 2) FL.drain FL.drain)
195+-------------------------------------------------------------------------------
197+-------------------------------------------------------------------------------
199+{-# INLINE parseMany #-}
200+parseMany :: MonadThrow m => Int -> SerialT m Int -> m ()
201+parseMany value = IP.drain . IP.parseManyD (drainWhile (<= value + 1))
203+{-# INLINE parseManyGroups #-}
204+parseManyGroups :: MonadThrow m => Bool -> SerialT m Int -> m ()
205+parseManyGroups b = IP.drain . IP.parseManyD (PR.groupBy (\_ _ -> b) FL.drain)
207+{-# INLINE parseManyGroupsRolling #-}
208+parseManyGroupsRolling :: MonadThrow m => Bool -> SerialT m Int -> m ()
209+parseManyGroupsRolling b =
210+ IP.drain . IP.parseManyD (PR.groupByRolling (\_ _ -> b) FL.drain)
195-------------------------------------------------------------------------------
212-------------------------------------------------------------------------------
196-- Parsers in which -fspec-constr-recursive=16 is problematic
213-- Parsers in which -fspec-constr-recursive=16 is problematic
197-------------------------------------------------------------------------------
214-------------------------------------------------------------------------------
@@ -276,6 +293,18 @@ o_1_space_serial_spanning value =
276 , benchIOSink value "spanByRolling" $ spanByRolling value
293 , benchIOSink value "spanByRolling" $ spanByRolling value
296+o_1_space_serial_nested :: Int -> [Benchmark]
297+o_1_space_serial_nested value =
298+ [ benchIOSink value "parseMany" $ parseMany value
299+ , benchIOSink value "parseMany groupBy (bound groups)"
300+ $ (parseManyGroups False)
301+ , benchIOSink value "parseMany groupRollingBy (bound groups)"
302+ $ (parseManyGroupsRolling False)
303+ , benchIOSink value "parseMany groupBy (1 group)" $ (parseManyGroups True)
304+ , benchIOSink value "parseMany groupRollingBy (1 group)"
305+ $ (parseManyGroupsRolling True)
279o_n_heap_serial :: Int -> [Benchmark]
308o_n_heap_serial :: Int -> [Benchmark]
280o_n_heap_serial value =
309o_n_heap_serial value =
@@ -312,6 +341,7 @@ main = do
312 allBenchmarks value =
341 allBenchmarks value =
313 [ bgroup (o_1_space_prefix moduleName) (o_1_space_serial value)
342 [ bgroup (o_1_space_prefix moduleName) (o_1_space_serial value)
314 , bgroup (o_1_space_prefix moduleName) (o_1_space_serial_spanning value)
343 , bgroup (o_1_space_prefix moduleName) (o_1_space_serial_spanning value)
344+ , bgroup (o_1_space_prefix moduleName) (o_1_space_serial_nested value)
315 , bgroup (o_n_heap_prefix moduleName) (o_n_heap_serial value)
345 , bgroup (o_n_heap_prefix moduleName) (o_n_heap_serial value)
316 , bgroup (o_n_space_prefix moduleName) (o_n_space_serial value)
346 , bgroup (o_n_space_prefix moduleName) (o_n_space_serial value)