git.iko.soy/typeable/attoparsec
on master help sign in
Inline more aggressively.

With cheaper per-iteration tests, this gains 15% on performance.

commitdd806f321dfade4f31cadb08ae1967cf92f9e810 authorBryan O'Sullivan <bos@serpentine.com> dateSat 27 Feb 2010, 12:56 (17 years ago) parent25871b6
1 file changed+3
Data/Attoparsec/Internal.hs+3
Data/Attoparsec/Internal.hs+3
@@ -266,6 +266,7 @@ skipWhile p = do
266266 if B.null t
267267 then (skipWhile p <|> return ())
268268 else return ()
269+{-# INLINE skipWhile #-}
269270
270271takeTill :: (Word8 -> Bool) -> Parser B.ByteString
271272takeTill p = takeWhile (not . p)
@@ -281,6 +282,7 @@ takeWhile p = go
281282 if B.null t
282283 then (h+++) `fmapP` (go <|> return B.empty)
283284 else return h
285+{-# INLINE takeWhile #-}
284286
285287takeWhile1 :: (Word8 -> Bool) -> Parser B.ByteString
286288takeWhile1 p = do
@@ -291,6 +293,7 @@ takeWhile1 p = do
291293 if B.null t
292294 then (h+++) `fmapP` (takeWhile p <|> return B.empty)
293295 else return h
296+{-# INLINE takeWhile1 #-}
294297
295298-- | Match any character in a set.
296299--