mirror of
https://github.com/composewell/streamly.git
synced 2024-11-09 17:55:23 +03:00
Add benchmarks for takeP
This commit is contained in:
parent
c375be2944
commit
15397be802
@ -97,6 +97,10 @@ sliceBeginWith value stream = do
|
||||
takeWhile :: MonadCatch m => Int -> SerialT m Int -> m ()
|
||||
takeWhile value = IP.parse (PR.takeWhile (<= value) FL.drain)
|
||||
|
||||
{-# INLINE takeP #-}
|
||||
takeP :: MonadCatch m => Int -> SerialT m a -> m ()
|
||||
takeP value = IP.parse (PR.takeP value (PR.fromFold FL.drain))
|
||||
|
||||
{-# INLINE groupBy #-}
|
||||
groupBy :: MonadCatch m => SerialT m Int -> m ()
|
||||
groupBy = IP.parse (PR.groupBy (<=) FL.drain)
|
||||
@ -327,6 +331,7 @@ o_1_space_serial value =
|
||||
[ benchIOSink value "takeBetween" $ takeBetween value
|
||||
, benchIOSink value "takeEQ" $ takeEQ value
|
||||
, benchIOSink value "takeWhile" $ takeWhile value
|
||||
, benchIOSink value "takeP" $ takeP value
|
||||
, benchIOSink value "drainWhile" $ drainWhile value
|
||||
, benchIOSink value "sliceBeginWith" $ sliceBeginWith value
|
||||
, benchIOSink value "groupBy" $ groupBy
|
||||
|
@ -79,6 +79,10 @@ sliceBeginWith value stream = do
|
||||
takeWhile :: MonadThrow m => Int -> SerialT m Int -> m ()
|
||||
takeWhile value = IP.parseD (drainWhile (<= value))
|
||||
|
||||
{-# INLINE takeP #-}
|
||||
takeP :: MonadThrow m => Int -> SerialT m a -> m ()
|
||||
takeP value = IP.parseD (PR.takeP value (PR.fromFold FL.drain))
|
||||
|
||||
{-# INLINE groupBy #-}
|
||||
groupBy :: MonadThrow m => SerialT m Int -> m ()
|
||||
groupBy = IP.parseD (PR.groupBy (<=) FL.drain)
|
||||
@ -289,6 +293,7 @@ moduleName = "Data.Parser.ParserD"
|
||||
o_1_space_serial :: Int -> [Benchmark]
|
||||
o_1_space_serial value =
|
||||
[ benchIOSink value "takeWhile" $ takeWhile value
|
||||
, benchIOSink value "takeP" $ takeP value
|
||||
, benchIOSink value "sliceBeginWith" $ sliceBeginWith value
|
||||
, benchIOSink value "groupBy" $ groupBy
|
||||
, benchIOSink value "groupByRolling" $ groupByRolling
|
||||
|
Loading…
Reference in New Issue
Block a user