Permalink
Browse files

Added bracketIO benchmarks

Ignore-this: 8c0799d71b2ad6274caa3e74d2bb07e9

darcs-hash:20110304193011-ae560-df1919f6210e7e97e09b6432d1ec366d12638364.gz
  • Loading branch information...
basvandijk committed Mar 4, 2011
1 parent d9fbf80 commit 5cd7c4356bf094873e3fe00774bd9c35cbfc2727
Showing with 13 additions and 5 deletions.
  1. +1 −1 bench-monad-peel-control.cabal
  2. +12 −4 bench.hs
@@ -21,6 +21,6 @@ executable bench-monad-peel-control
, base-unicode-symbols >= 0.1.1 && < 0.3
, transformers >= 0.2 && < 0.3
, criterion >= 0.5 && < 0.6
- , monad-control >= 0.1 && < 0.3
+ , monad-control >= 0.2.1 && < 0.3
, monad-peel >= 0.1 && < 0.2
, MonadCatchIO-transformers >= 0.2.2.2 && < 0.3
View
@@ -41,10 +41,15 @@ import qualified Control.Monad.CatchIO as MCIO
main :: IO ()
main = defaultMain
- [ benchAll "bracket" benchBracket MCIO.bracket MP.bracket MC.bracket
- , benchAll "bracket_" benchBracket_ MCIO.bracket_ MP.bracket_ MC.bracket_
- , benchAll "catch" benchCatch MCIO.catch MP.catch MC.catch
- , benchAll "try" benchTry MCIO.try MP.try MC.try
+ [ benchAll "bracket" benchBracket MCIO.bracket MP.bracket MC.bracket
+ , bgroup "bracketIO" [bench "monad-control" benchBracketIO]
+
+ , benchAll "bracket_" benchBracket_ MCIO.bracket_ MP.bracket_ MC.bracket_
+ , bgroup "bracketIO_" [bench "monad-control" benchBracketIO_]
+
+ , benchAll "catch" benchCatch MCIO.catch MP.catch MC.catch
+
+ , benchAll "try" benchTry MCIO.try MP.try MC.try
, bgroup "mask"
[ bench "monad-peel" $ benchMask mpMask
@@ -83,6 +88,9 @@ benchBracket_ bracket_ = exe $ bracket_ nop nop nop
benchCatch catch = exe $ catch throwE (\E -> nop)
benchTry try = exe $ try throwE :: R (Either E ())
+benchBracketIO = exe $ MC.bracketIO nop (\_ -> nop) (\_ -> nop)
+benchBracketIO_ = exe $ MC.bracketIO_ nop nop nop
+
benchMask :: (((forall a. M a -> M a) -> M ()) -> M ()) -> R ()
benchMask mask = exe $ mask $ \restore -> nop >> restore nop >> nop

0 comments on commit 5cd7c43

Please sign in to comment.