git.iko.soy/effects-benchmarks
on master help sign in
Updated benchmarks
edf18f2iko
effects-benchmarks.cabal+5
@@ -18,18 +18,23 @@ benchmark effects-benchmarks
18 ExtEff.HTTP
18 ExtEff.HTTP
19 ExtEff.Stateful
19 ExtEff.Stateful
20 ExtEff.StatefulExcept
20 ExtEff.StatefulExcept
21+ Freer.Bench
21 Freer.HTTP
22 Freer.HTTP
22 Freer.Stateful
23 Freer.Stateful
23 Freer.StatefulExcept
24 Freer.StatefulExcept
25+ Fused.Bench
24 Fused.HTTP
26 Fused.HTTP
25 Fused.Stateful
27 Fused.Stateful
26 Fused.StatefulExcept
28 Fused.StatefulExcept
29+ MTL.Bench
27 MTL.HTTP
30 MTL.HTTP
28 MTL.Stateful
31 MTL.Stateful
29 MTL.StatefulExcept
32 MTL.StatefulExcept
33+ Poly.Bench
30 Poly.HTTP
34 Poly.HTTP
31 Poly.Stateful
35 Poly.Stateful
32 Poly.StatefulExcept
36 Poly.StatefulExcept
37+ Shallow.Bench
33 Shallow.HTTP
38 Shallow.HTTP
34 Shallow.Stateful
39 Shallow.Stateful
35 Shallow.StatefulExcept
40 Shallow.StatefulExcept
hie.yamlnew file+7
@@ -0,0 +1,7 @@
1+cradle:
2+ stack:
3+ - path: "./instances"
4+ component: "effects-benchmarks:bench:effects-benchmarks"
5+
6+ - path: "./src/Main.hs"
7+ component: "effects-benchmarks:bench:effects-benchmarks"
instances/ExtEff/Bench.hsnew file+21
@@ -0,0 +1,21 @@
1+module ExtEff.Bench
2+ ( countDownBench
3+ , countDownExcBench
4+ , httpBench
5+ ) where
6+
7+import ExtEff.Stateful
8+import ExtEff.StatefulExcept
9+import ExtEff.HTTP
10+import Control.Eff.State.Strict
11+import Control.Eff.Exception
12+import Control.Eff
13+
14+countDownBench :: Int -> (Int, Int)
15+countDownBench start = run . runState start $ countDownPut
16+
17+countDownExcBench :: Int -> Either String (Int, Int)
18+countDownExcBench start = run . runError . runState start $ countDownExc
19+
20+httpBench :: Int -> IO Int
21+httpBench n = runHttp (doHTTP n)
instances/ExtEff/HTTP.hs+2−2
@@ -40,8 +40,8 @@ doHttp = fix (handle_relay pure)
40runHttp :: HttpM a -> IO a
40runHttp :: HttpM a -> IO a
41runHttp = runLift . doHttp
41runHttp = runLift . doHttp
42
42
43−doHTTP :: Int -> IO Int
43+doHTTP :: Int -> Eff '[HTTP, Lift IO] Int
44−doHTTP n = runHttp $ do
44+doHTTP n = do
45 open' "cats"
45 open' "cats"
46 replicateM_ n (get' *> post' "cats")
46 replicateM_ n (get' *> post' "cats")
47 close'
47 close'
instances/ExtEff/Stateful.hs+5−16
@@ -1,22 +1,11 @@
1+{-# LANGUAGE MonoLocalBinds #-}
2+{-# LANGUAGE FlexibleContexts #-}
1{-# LANGUAGE DataKinds, TypeApplications #-}
3{-# LANGUAGE DataKinds, TypeApplications #-}
2
4
3module ExtEff.Stateful where
5module ExtEff.Stateful where
4
6
5import Control.Eff
7import Control.Eff
6−import Control.Eff.State.Strict as State
8+import Control.Eff.State.Strict
7−import Data.Tuple
8
9
9−type StateM = Eff '[State Int]
10+countDownPut :: Member (State Int) r => Eff r Int
10−
11−get' :: StateM Int
12−get' = State.get @Int
13−
14−put' :: Int -> StateM ()
15−put' = State.put @Int
16−
17−runStateful :: Int -> StateM a -> (Int, a)
18−runStateful n x = swap . run $ State.runState n x
19−
20−countDownPut :: Int -> (Int, Int)
21−countDownPut start = runStateful start go where
22− go = get' >>= (\n -> if n < 0 then pure n else put' (n - 1) *> go)
11+countDownPut = get >>= (\n -> if n < 0 then pure n else put (n - 1) *> countDownPut)
instances/ExtEff/StatefulExcept.hs+5−19
@@ -1,25 +1,11 @@
1+{-# LANGUAGE MonoLocalBinds #-}
2+{-# LANGUAGE FlexibleContexts #-}
1{-# LANGUAGE TypeApplications, DataKinds #-}
3{-# LANGUAGE TypeApplications, DataKinds #-}
2module ExtEff.StatefulExcept where
4module ExtEff.StatefulExcept where
3
5
4import Control.Eff
6import Control.Eff
5−import Control.Eff.State.Strict as State
7+import Control.Eff.State.Strict
6import Control.Eff.Exception
8import Control.Eff.Exception
7−import Data.Tuple
8
9
9−type StateM = Eff '[State Int, Exc String]
10+countDownExc :: (Member (State Int) r, Member (Exc String) r) => Eff r b
10−
11−get' :: StateM Int
12−get' = State.get @Int
13−
14−put' :: Int -> StateM ()
15−put' = State.put @Int
16−
17−throw :: String -> StateM a
18−throw = throwError
19−
20−runStatefulExcept :: Int -> StateM a -> Either String (Int, a)
21−runStatefulExcept n x = fmap swap . run . runError $ State.runState n x
22−
23−countDownExc :: Int -> Either String (Int, Int)
24−countDownExc start = runStatefulExcept start go where
25− go = get' >>= (\n -> if n <= 0 then throw "what" else put' (n - 1) *> go)
11+countDownExc = get @Int >>= (\n -> if n <= 0 then throwError "what" else put @Int (n - 1) *> countDownExc)
instances/Freer/Bench.hsnew file+21
@@ -0,0 +1,21 @@
1+module Freer.Bench
2+ ( countDownBench
3+ , countDownExcBench
4+ , httpBench
5+ ) where
6+
7+import Freer.Stateful
8+import Freer.StatefulExcept
9+import Freer.HTTP
10+import Control.Monad.Freer.State
11+import Control.Monad.Freer.Error
12+import Control.Monad.Freer
13+
14+countDownBench :: Int -> (Int, Int)
15+countDownBench start = run . runState start $ countDownPut
16+
17+countDownExcBench :: Int -> Either String (Int, Int)
18+countDownExcBench start = run . runError . runState start $ countDownExc
19+
20+httpBench :: Int -> IO Int
21+httpBench n = runHttp (doHTTP n)
instances/Freer/HTTP.hs+2−2
@@ -36,8 +36,8 @@ doHttp = interpret
36runHttp :: HttpM a -> IO a
36runHttp :: HttpM a -> IO a
37runHttp = runM . doHttp
37runHttp = runM . doHttp
38
38
39−doHTTP :: Int -> IO Int
39+doHTTP :: Int -> Eff '[HTTP, IO] Int
40−doHTTP n = runHttp $ do
40+doHTTP n = do
41 open' "cats"
41 open' "cats"
42 replicateM_ n (get' *> post' "cats")
42 replicateM_ n (get' *> post' "cats")
43 close'
43 close'
instances/Freer/Stateful.hs+4−15
@@ -1,22 +1,11 @@
1+{-# LANGUAGE MonoLocalBinds #-}
2+{-# LANGUAGE FlexibleContexts #-}
1{-# LANGUAGE TypeApplications, DataKinds #-}
3{-# LANGUAGE TypeApplications, DataKinds #-}
2
4
3module Freer.Stateful where
5module Freer.Stateful where
4
6
5import Control.Monad.Freer
7import Control.Monad.Freer
6import Control.Monad.Freer.State as State
8import Control.Monad.Freer.State as State
7−import Data.Tuple
8
9
9−type StateM = Eff '[State Int]
10+countDownPut :: Member (State Int) r => Eff r Int
10−
11−get' :: StateM Int
12−get' = State.get @Int
13−
14−put' :: Int -> StateM ()
15−put' = State.put @Int
16−
17−runStateful :: Int -> StateM a -> (Int, a)
18−runStateful n x = swap . run $ State.runState n x
19−
20−countDownPut :: Int -> (Int, Int)
21−countDownPut start = runStateful start go where
22− go = get' >>= (\n -> if n < 0 then pure n else put' (n - 1) *> go)
11+countDownPut = get >>= (\n -> if n < 0 then pure n else put (n - 1) *> countDownPut)
instances/Freer/StatefulExcept.hs+4−19
@@ -2,24 +2,9 @@
2module Freer.StatefulExcept where
2module Freer.StatefulExcept where
3
3
4import Control.Monad.Freer
4import Control.Monad.Freer
5−import Control.Monad.Freer.State as State
5+import Control.Monad.Freer.State
6import Control.Monad.Freer.Error
6import Control.Monad.Freer.Error
7−import Data.Tuple
8
7
9−type StateM = Eff '[State Int, Error String]
8+countDownExc :: Eff '[State Int, Error String] b
10−
11−get' :: StateM Int
12−get' = State.get @Int
13−
14−put' :: Int -> StateM ()
15−put' = State.put @Int
16−
17−throw :: String -> StateM a
18−throw = throwError
19−
20−runStatefulExcept :: Int -> StateM a -> Either String (Int, a)
21−runStatefulExcept n x = fmap swap . run . runError $ State.runState n x
22−
23−countDownExc :: Int -> Either String (Int, Int)
9+countDownExc = go where
24−countDownExc start = runStatefulExcept start go where
25− go = get' >>= (\n -> if n <= 0 then throw "what" else put' (n - 1) *> go)
10+ go = get @Int >>= (\n -> if n <= 0 then throwError "what" else put @Int (n - 1) *> go)
instances/Fused/Bench.hsnew file+20
@@ -0,0 +1,20 @@
1+module Fused.Bench
2+ ( countDownBench
3+ , countDownExcBench
4+ , httpBench
5+ ) where
6+
7+import Fused.Stateful
8+import Fused.StatefulExcept
9+import Fused.HTTP
10+import Control.Carrier.State.Strict
11+import Control.Carrier.Error.Either
12+
13+countDownBench :: Int -> (Int, Int)
14+countDownBench start = run . runState start $ countDownPut
15+
16+countDownExcBench :: Int -> Either String (Int, Int)
17+countDownExcBench start = run . runError . runState start $ countDownExc
18+
19+httpBench :: Int -> IO Int
20+httpBench n = runHttp (doHTTP n)
instances/Fused/HTTP.hs+2−2
@@ -45,8 +45,8 @@ instance (Effect sig, Algebra sig m) => Algebra (HTTP :+: sig) (HttpC m) where
45runHttp :: HttpM a -> IO a
45runHttp :: HttpM a -> IO a
46runHttp = runM . runHttpC
46runHttp = runM . runHttpC
47
47
48−doHTTP :: Int -> IO Int
48+doHTTP :: Int -> HttpC (LiftC IO) Int
49−doHTTP n = runHttp $ do
49+doHTTP n = do
50 open' "cats"
50 open' "cats"
51 replicateM_ n (get' *> post' "cats")
51 replicateM_ n (get' *> post' "cats")
52 close'
52 close'
instances/Fused/Stateful.hs+3−16
@@ -2,20 +2,7 @@
2
2
3module Fused.Stateful where
3module Fused.Stateful where
4
4
5−import Control.Carrier.State.Lazy as State
5+import Control.Effect.State
6−import Data.Functor.Identity
7
6
8−type StateM = StateC Int Identity
7+countDownPut :: Has (State Int) sig m => m Int
9−
10−get' :: StateM Int
11−get' = State.get @Int
12−
13−put' :: Int -> StateM ()
14−put' = State.put @Int
15−
16−runStateful :: Int -> StateM a -> (Int, a)
17−runStateful n x = run $ State.runState n x
18−
19−countDownPut :: Int -> (Int, Int)
20−countDownPut start = runStateful start go where
21− go = get' >>= (\n -> if n < 0 then pure n else put' (n - 1) *> go)
8+countDownPut = get >>= (\n -> if n < 0 then pure n else put (n - 1) *> countDownPut)
instances/Fused/StatefulExcept.hs+5−18
@@ -2,24 +2,11 @@
2
2
3module Fused.StatefulExcept where
3module Fused.StatefulExcept where
4
4
5−import Control.Carrier.State.Strict as State
6−import Control.Carrier.Error.Either
7−import Data.Functor.Identity
8
5
9−type StateM = StateC Int (ErrorC String Identity)
6+import Control.Effect.Error
7+import Control.Effect.State
10
8
11−get' :: StateM Int
12−get' = State.get @Int
13
9
14−put' :: Int -> StateM ()
10+countDownExc :: (Has (State Int) sig m, Has (Error String) sig m) => m a
15−put' = State.put @Int
16−
17−throw :: String -> StateM a
18−throw = throwError
19−
20−runStatefulExcept :: Int -> StateM a -> Either String (Int, a)
21−runStatefulExcept n x = run . runError $ State.runState n x
22−
23−countDownExc :: Int -> Either String (Int, Int)
24−countDownExc start = runStatefulExcept start go where
11+countDownExc =
25− go = get' >>= (\n -> if n <= 0 then throw "what" else put' (n - 1) *> go)
12+ get @Int >>= (\n -> if n <= 0 then throwError "what" else put @Int (n - 1) *> countDownExc)
instances/MTL/Bench.hsnew file+20
@@ -0,0 +1,20 @@
1+module MTL.Bench
2+ ( countDownBench
3+ , countDownExcBench
4+ , httpBench
5+ ) where
6+
7+import MTL.Stateful
8+import MTL.StatefulExcept
9+import MTL.HTTP
10+import Control.Monad.State.Strict
11+import Control.Monad.Except
12+
13+countDownBench :: Int -> (Int, Int)
14+countDownBench start = flip runState start $ countDownPut
15+
16+countDownExcBench :: Int -> Either String (Int, Int)
17+countDownExcBench start = runExcept . flip runStateT start $ countDownExc
18+
19+httpBench :: Int -> IO Int
20+httpBench n = runHttp (doHTTP n)
instances/MTL/HTTP.hs+2−2
@@ -46,8 +46,8 @@ runHttp = \case
46 Post s -> pure ("posted " <> s)
46 Post s -> pure ("posted " <> s)
47 HGet -> pure "lmap"
47 HGet -> pure "lmap"
48
48
49−doHTTP :: Int -> IO Int
49+doHTTP :: Int -> HttpM Int
50−doHTTP n = runHttp $ do
50+doHTTP n = do
51 open' "cats"
51 open' "cats"
52 replicateM_ n (get' *> post' "cats")
52 replicateM_ n (get' *> post' "cats")
53 close'
53 close'
instances/MTL/Stateful.hs+4−17
@@ -1,20 +1,7 @@
1+{-# LANGUAGE FlexibleContexts #-}
1module MTL.Stateful where
2module MTL.Stateful where
2
3
3−import qualified Control.Monad.State.Strict as MTL
4+import Control.Monad.State.Class
4−import Data.Tuple
5−import Data.Functor.Identity
6
5
7−type StateM = MTL.StateT Int Identity
6+countDownPut :: MonadState Int m => m Int
8−
9−get :: StateM Int
10−get = MTL.get
11−
12−put :: Int -> StateM ()
13−put = MTL.put
14−
15−runStateful :: Int -> StateM a -> (Int, a)
16−runStateful n x = swap (MTL.runState x n)
17−
18−countDownPut :: Int -> (Int, Int)
19−countDownPut start = runStateful start go where
20− go = get >>= (\n -> if n < 0 then pure n else put (n - 1) *> go)
7+countDownPut = get >>= (\n -> if n < 0 then pure n else put (n - 1) *> countDownPut)
instances/MTL/StatefulExcept.hs+5−21
@@ -1,24 +1,8 @@
1+{-# LANGUAGE FlexibleContexts #-}
1module MTL.StatefulExcept where
2module MTL.StatefulExcept where
2
3
3−import qualified Control.Monad.State.Strict as MTL
4+import Control.Monad.State.Class
4−import qualified Control.Monad.Except as MTL
5+import Control.Monad.Error.Class
5−import Data.Tuple
6−import Data.Functor.Identity
7
6
8−type StateM = MTL.StateT Int (MTL.ExceptT String Identity)
7+countDownExc :: (MonadState Int m, MonadError String m) => m a
9−
10−get :: StateM Int
11−get = MTL.get
12−
13−put :: Int -> StateM ()
14−put = MTL.put
15−
16−throw :: String -> StateM a
17−throw = MTL.throwError
18−
19−runStatefulExcept :: Int -> StateM a -> Either String (Int, a)
20−runStatefulExcept n x = fmap swap . MTL.runExcept $ MTL.runStateT x n
21−
22−countDownExc :: Int -> Either String (Int, Int)
23−countDownExc start = runStatefulExcept start go where
24− go = get >>= (\n -> if n <= 0 then throw "what" else put (n - 1) *> go)
8+countDownExc = get >>= (\n -> if n <= 0 then throwError "what" else put (n - 1) *> countDownExc)
instances/Poly/Bench.hsnew file+21
@@ -0,0 +1,21 @@
1+module Poly.Bench
2+ ( countDownBench
3+ , countDownExcBench
4+ , httpBench
5+ ) where
6+
7+import Poly.Stateful
8+import Poly.StatefulExcept
9+import Poly.HTTP
10+import Polysemy.State
11+import Polysemy
12+import Polysemy.Error
13+
14+countDownBench :: Int -> (Int, Int)
15+countDownBench start = run . runState start $ countDownPut
16+
17+countDownExcBench :: Int -> Either String (Int, Int)
18+countDownExcBench start = run . runError . runState start $ countDownExc
19+
20+httpBench :: Int -> IO Int
21+httpBench n = runHttp (doHTTP n)
instances/Poly/HTTP.hs+2−2
@@ -37,8 +37,8 @@ runHttp' = interpret $ \case
37runHttp :: HttpM a -> IO a
37runHttp :: HttpM a -> IO a
38runHttp = runFinal . runHttp'
38runHttp = runFinal . runHttp'
39
39
40−doHTTP :: Int -> IO Int
40+doHTTP :: Int -> Sem '[Http, Final IO] Int
41−doHTTP n = runHttp $ do
41+doHTTP n = do
42 open' "cats"
42 open' "cats"
43 replicateM_ n (get' *> post' "cats")
43 replicateM_ n (get' *> post' "cats")
44 close'
44 close'
instances/Poly/Stateful.hs+5−15
@@ -1,21 +1,11 @@
1+{-# LANGUAGE GADTs #-}
2+{-# LANGUAGE FlexibleContexts #-}
1{-# LANGUAGE DataKinds, TypeApplications #-}
3{-# LANGUAGE DataKinds, TypeApplications #-}
2
4
3module Poly.Stateful where
5module Poly.Stateful where
4
6
5import Polysemy
7import Polysemy
6−import Polysemy.State as State
8+import Polysemy.State
7
9
8−type StateM = Sem '[State Int]
10+countDownPut :: Member (State Int) r => Sem r Int
9−
10−get' :: StateM Int
11−get' = State.get @Int
12−
13−put' :: Int -> StateM ()
14−put' = State.put @Int
15−
16−runStateful :: Int -> StateM a -> (Int, a)
17−runStateful n x = run $ State.runState n x
18−
19−countDownPut :: Int -> (Int, Int)
20−countDownPut start = runStateful start go where
21− go = get' >>= (\n -> if n < 0 then pure n else put' (n - 1) *> go)
11+countDownPut = get >>= (\n -> if n < 0 then pure n else put (n - 1) *> countDownPut)
instances/Poly/StatefulExcept.hs+6−19
@@ -1,24 +1,11 @@
1+{-# LANGUAGE GADTs #-}
2+{-# LANGUAGE FlexibleContexts #-}
1{-# LANGUAGE TypeApplications, DataKinds #-}
3{-# LANGUAGE TypeApplications, DataKinds #-}
2module Poly.StatefulExcept where
4module Poly.StatefulExcept where
3
5
4import Polysemy
6import Polysemy
5−import Polysemy.State as State
7+import Polysemy.State
6−import Polysemy.Error as Err
8+import Polysemy.Error
7
9
8−type StateM = Sem '[State Int, Error String]
10+countDownExc :: (Member (State Int) r, Member (Error String) r) => Sem r a
9−
10−get' :: StateM Int
11−get' = State.get @Int
12−
13−put' :: Int -> StateM ()
14−put' = State.put @Int
15−
16−throw' :: String -> StateM a
17−throw' = Err.throw
18−
19−runStatefulExcept :: Int -> StateM a -> Either String (Int, a)
20−runStatefulExcept n x = run . runError $ State.runState n x
21−
22−countDownExc :: Int -> Either String (Int, Int)
23−countDownExc start = runStatefulExcept start go where
24− go = get' >>= (\n -> if n <= 0 then throw' "what" else put' (n - 1) *> go)
11+countDownExc = get @Int >>= (\n -> if n <= 0 then throw "what" else put @Int (n - 1) *> countDownExc)
instances/Shallow/Bench.hsnew file+18
@@ -0,0 +1,18 @@
1+module Shallow.Bench
2+ ( countDownBench
3+ , countDownExcBench
4+ , httpBench
5+ ) where
6+
7+import Shallow.Stateful
8+import Shallow.StatefulExcept
9+import Shallow.HTTP
10+
11+countDownBench :: Int -> (Int, Int)
12+countDownBench = countDownPut
13+
14+countDownExcBench :: Int -> Either String (Int, Int)
15+countDownExcBench = countDownExc
16+
17+httpBench :: Int -> IO Int
18+httpBench = doHTTP
src/Main.hs+36−50
@@ -6,26 +6,12 @@ import Gauge (bench, bgroup, nf, nfAppIO)
6import Gauge.Main (defaultMain)
6import Gauge.Main (defaultMain)
7import qualified Weigh
7import qualified Weigh
8
8
9−import qualified Fused.Stateful as Fused
9+import qualified Fused.Bench as Fused
10−import qualified Freer.Stateful as Freer
10+import qualified Freer.Bench as Freer
11−import qualified Shallow.Stateful as Shallow
11+import qualified Shallow.Bench as Shallow
12−import qualified MTL.Stateful as MTL
12+import qualified MTL.Bench as MTL
13−import qualified Poly.Stateful as Poly
13+import qualified Poly.Bench as Poly
14−import qualified ExtEff.Stateful as ExtEff
14+import qualified ExtEff.Bench as ExtEff
15−
16−import qualified Fused.StatefulExcept as Fused
17−import qualified Freer.StatefulExcept as Freer
18−import qualified Shallow.StatefulExcept as Shallow
19−import qualified MTL.StatefulExcept as MTL
20−import qualified Poly.StatefulExcept as Poly
21−import qualified ExtEff.StatefulExcept as ExtEff
22−
23−import qualified Fused.HTTP as Fused
24−import qualified Freer.HTTP as Freer
25−import qualified MTL.HTTP as MTL
26−import qualified Shallow.HTTP as Shallow
27−import qualified Poly.HTTP as Poly
28−import qualified ExtEff.HTTP as ExtEff
29
15
30wruns :: Int
16wruns :: Int
31wruns = 1
17wruns = 1
@@ -40,47 +26,47 @@ main = do
40 [
26 [
41 bgroup "Countdown"
27 bgroup "Countdown"
42 [ bgroup "Put"
28 [ bgroup "Put"
43− [ bench "fused-effects" (nf Fused.countDownPut runs)
29+ [ bench "fused-effects" (nf Fused.countDownBench runs)
44− , bench "mtl" (nf MTL.countDownPut runs)
30+ , bench "mtl" (nf MTL.countDownBench runs)
45− , bench "polysemy" (nf Poly.countDownPut runs)
31+ , bench "polysemy" (nf Poly.countDownBench runs)
46− , bench "freer-simple" (nf Freer.countDownPut runs)
32+ , bench "freer-simple" (nf Freer.countDownBench runs)
47− , bench "extensible-effects" (nf ExtEff.countDownPut runs)
33+ , bench "extensible-effects" (nf ExtEff.countDownBench runs)
48− , bench "shallow" (nf Shallow.countDownPut runs)
34+ , bench "shallow" (nf Shallow.countDownBench runs)
49 ]
35 ]
50 , bgroup "Put+Exc"
36 , bgroup "Put+Exc"
51− [ bench "fused-effects" (nf Fused.countDownExc runs)
37+ [ bench "fused-effects" (nf Fused.countDownExcBench runs)
52− , bench "mtl" (nf MTL.countDownExc runs)
38+ , bench "mtl" (nf MTL.countDownExcBench runs)
53− , bench "polysemy" (nf Poly.countDownExc runs)
39+ , bench "polysemy" (nf Poly.countDownExcBench runs)
54− , bench "freer-simple" (nf Freer.countDownExc runs)
40+ , bench "freer-simple" (nf Freer.countDownExcBench runs)
55− , bench "extensible-effects" (nf ExtEff.countDownExc runs)
41+ , bench "extensible-effects" (nf ExtEff.countDownExcBench runs)
56− , bench "shallow" (nf Shallow.countDownExc runs)
42+ , bench "shallow" (nf Shallow.countDownExcBench runs)
57 ]
43 ]
58 ]
44 ]
59 , bgroup "HTTP"
45 , bgroup "HTTP"
60− [ bench "fused-effects" (nfAppIO Fused.doHTTP runs)
46+ [ bench "fused-effects" (nfAppIO Fused.httpBench runs)
61− , bench "polysemy" (nfAppIO Poly.doHTTP runs)
47+ , bench "polysemy" (nfAppIO Poly.httpBench runs)
62− , bench "extensible-effects" (nfAppIO ExtEff.doHTTP runs)
48+ , bench "extensible-effects" (nfAppIO ExtEff.httpBench runs)
63− , bench "Deep embedding" (nfAppIO MTL.doHTTP runs)
49+ , bench "Deep embedding" (nfAppIO MTL.httpBench runs)
64− , bench "Shallow embedding" (nfAppIO Shallow.doHTTP runs)
50+ , bench "Shallow embedding" (nfAppIO Shallow.httpBench runs)
65− , bench "freer-simple" (nfAppIO Freer.doHTTP runs)
51+ , bench "freer-simple" (nfAppIO Freer.httpBench runs)
66 ]
52 ]
67 ]
53 ]
68
54
69 putStrLn "*** Space benchmarks (these will take some time to run) ***"
55 putStrLn "*** Space benchmarks (these will take some time to run) ***"
70 Weigh.mainWith $ do
56 Weigh.mainWith $ do
71 Weigh.wgroup "Countdown" $ sequence_
57 Weigh.wgroup "Countdown" $ sequence_
72− [ Weigh.func "fused-effects" Fused.countDownPut wruns
58+ [ Weigh.func "fused-effects" Fused.countDownBench wruns
73− , Weigh.func "mtl" MTL.countDownPut wruns
59+ , Weigh.func "mtl" MTL.countDownBench wruns
74− , Weigh.func "polysemy" Poly.countDownPut wruns
60+ , Weigh.func "polysemy" Poly.countDownBench wruns
75− , Weigh.func "freer-simple" Freer.countDownPut wruns
61+ , Weigh.func "freer-simple" Freer.countDownBench wruns
76− , Weigh.func "extensible-effects" ExtEff.countDownPut wruns
62+ , Weigh.func "extensible-effects" ExtEff.countDownBench wruns
77− , Weigh.func "shallow" Shallow.countDownPut wruns
63+ , Weigh.func "shallow" Shallow.countDownBench wruns
78 ]
64 ]
79 Weigh.wgroup "Countdown + exc" $ sequence_
65 Weigh.wgroup "Countdown + exc" $ sequence_
80− [ Weigh.func "fused-effects" Fused.countDownExc wruns
66+ [ Weigh.func "fused-effects" Fused.countDownExcBench wruns
81− , Weigh.func "mtl" MTL.countDownExc wruns
67+ , Weigh.func "mtl" MTL.countDownExcBench wruns
82− , Weigh.func "polysemy" Poly.countDownExc wruns
68+ , Weigh.func "polysemy" Poly.countDownExcBench wruns
83− , Weigh.func "freer-simple" Freer.countDownExc wruns
69+ , Weigh.func "freer-simple" Freer.countDownExcBench wruns
84− , Weigh.func "extensible-effects" ExtEff.countDownExc wruns
70+ , Weigh.func "extensible-effects" ExtEff.countDownExcBench wruns
85− , Weigh.func "shallow" Shallow.countDownExc wruns
71+ , Weigh.func "shallow" Shallow.countDownExcBench wruns
86 ]
72 ]