Skip to content

Commit 1e9eff6

Browse files
Update README and commits.
1 parent 51dc8ee commit 1e9eff6

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Module documentation is [published on Pursuit](http://pursuit.purescript.org/pac
2222

2323
## Benchmarks
2424

25-
The following benchmarks compare the current implementation with the implementation at `v0.6.1` (purescript/purescript-free@0df59c5d459fed983131856886fc3a4b43234f1f), which used the `Gosub` technique to defer monadic binds.
25+
The following benchmarks compare the implementation at `v5.2.0` (commit f686f5fc07766f3ca9abc83b47b6ad3da326759a) with the implementation at `v0.6.1` (commit 0df59c5d459fed983131856886fc3a4b43234f1f), which used the `Gosub` technique to defer monadic binds.
2626

2727
![left-bind-small](benchmark/left-bind-small.png)
2828

benchmark/Benchmark/Free326759a.purs renamed to benchmark/Benchmark/Freef686f5f.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Benchmark.Free326759a
1+
module Benchmark.Freef686f5f
22
( Free
33
, suspendF
44
, wrap

benchmark/Benchmark/Main.purs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ module Benchmark.Main (main) where
22

33
import Prelude
44

5-
import Benchmark.Free326759a as Free326759a
5+
import Benchmark.Freef686f5f as Freef686f5f
66
import Benchmark.Trampoline0df59c5 as Trampoline0df59c5
7-
import Benchmark.Trampoline326759a as Trampoline326759a
7+
import Benchmark.Trampolinef686f5f as Trampolinef686f5f
88
import Benchotron.Core (Benchmark, benchFn, mkBenchmark)
99
import Benchotron.UI.Console (runSuite)
1010
import Data.Foldable (foldl)
@@ -30,19 +30,19 @@ leftBindSmallBenchmark =
3030
, inputsPerSize: inputsPerSize
3131
, gen: \n -> vectorOf n (pure 0.0)
3232
, functions:
33-
[ benchFn "Free v5.2.0" (Trampoline326759a.runTrampoline <<< binds)
33+
[ benchFn "Free v5.2.0" (Trampolinef686f5f.runTrampoline <<< binds)
3434
, benchFn "Free v0.6.1" (Trampoline0df59c5.runTrampoline <<< bindsT)
3535
]
3636
}
3737
where
3838
inputsPerSize :: Int
3939
inputsPerSize = 100
4040

41-
binds :: Array Number -> Trampoline326759a.Trampoline Number
41+
binds :: Array Number -> Trampolinef686f5f.Trampoline Number
4242
binds as = foldl (\b a -> b >>= const (gen a)) (gen 0.0) as
4343

44-
gen :: forall a. a -> Trampoline326759a.Trampoline a
45-
gen = Free326759a.suspendF <<< Trampoline326759a.done
44+
gen :: forall a. a -> Trampolinef686f5f.Trampoline a
45+
gen = Freef686f5f.suspendF <<< Trampolinef686f5f.done
4646

4747
bindsT :: Array Number -> Trampoline0df59c5.Trampoline Number
4848
bindsT as = foldl (\b a -> b >>= const (genT a)) (genT 0.0) as
@@ -60,19 +60,19 @@ rightBindSmallBenchmark =
6060
, inputsPerSize: inputsPerSize
6161
, gen: \n -> vectorOf n (pure 0.0)
6262
, functions:
63-
[ benchFn "Free v5.2.0" (Trampoline326759a.runTrampoline <<< binds)
63+
[ benchFn "Free v5.2.0" (Trampolinef686f5f.runTrampoline <<< binds)
6464
, benchFn "Free v0.6.1" (Trampoline0df59c5.runTrampoline <<< bindsT)
6565
]
6666
}
6767
where
6868
inputsPerSize :: Int
6969
inputsPerSize = 100
7070

71-
binds :: Array Number -> Trampoline326759a.Trampoline Number
71+
binds :: Array Number -> Trampolinef686f5f.Trampoline Number
7272
binds as = foldl (\b a -> gen a >>= const b) (gen 0.0) as
7373

74-
gen :: forall a. a -> Trampoline326759a.Trampoline a
75-
gen = Free326759a.suspendF <<< Trampoline326759a.done
74+
gen :: forall a. a -> Trampolinef686f5f.Trampoline a
75+
gen = Freef686f5f.suspendF <<< Trampolinef686f5f.done
7676

7777
bindsT :: Array Number -> Trampoline0df59c5.Trampoline Number
7878
bindsT as = foldl (\b a -> genT a >>= const b) (genT 0.0) as
@@ -90,7 +90,7 @@ leftBindLargeBenchmark =
9090
, inputsPerSize: inputsPerSize
9191
, gen: \n -> vectorOf n (pure 0.0)
9292
, functions:
93-
[ benchFn "Free v5.2.0" (Trampoline326759a.runTrampoline <<< binds)
93+
[ benchFn "Free v5.2.0" (Trampolinef686f5f.runTrampoline <<< binds)
9494
-- Disabled due to stack overflow
9595
-- , benchFn "Free v0.6.1" (Trampoline0df59c5.runTrampoline <<< bindsT)
9696
]
@@ -99,11 +99,11 @@ leftBindLargeBenchmark =
9999
inputsPerSize :: Int
100100
inputsPerSize = 1
101101

102-
binds :: Array Number -> Trampoline326759a.Trampoline Number
102+
binds :: Array Number -> Trampolinef686f5f.Trampoline Number
103103
binds as = foldl (\b a -> b >>= const (gen a)) (gen 0.0) as
104104

105-
gen :: forall a. a -> Trampoline326759a.Trampoline a
106-
gen = Free326759a.suspendF <<< Trampoline326759a.done
105+
gen :: forall a. a -> Trampolinef686f5f.Trampoline a
106+
gen = Freef686f5f.suspendF <<< Trampolinef686f5f.done
107107

108108
bindsT :: Array Number -> Trampoline0df59c5.Trampoline Number
109109
bindsT as = foldl (\b a -> b >>= const (genT a)) (genT 0.0) as
@@ -121,19 +121,19 @@ rightBindLargeBenchmark =
121121
, inputsPerSize: inputsPerSize
122122
, gen: \n -> vectorOf n (pure 0.0)
123123
, functions:
124-
[ benchFn "Free v5.2.0" (Trampoline326759a.runTrampoline <<< binds)
124+
[ benchFn "Free v5.2.0" (Trampolinef686f5f.runTrampoline <<< binds)
125125
, benchFn "Free v0.6.1" (Trampoline0df59c5.runTrampoline <<< bindsT)
126126
]
127127
}
128128
where
129129
inputsPerSize :: Int
130130
inputsPerSize = 1
131131

132-
binds :: Array Number -> Trampoline326759a.Trampoline Number
132+
binds :: Array Number -> Trampolinef686f5f.Trampoline Number
133133
binds as = foldl (\b a -> gen a >>= const b) (gen 0.0) as
134134

135-
gen :: forall a. a -> Trampoline326759a.Trampoline a
136-
gen = Free326759a.suspendF <<< Trampoline326759a.done
135+
gen :: forall a. a -> Trampolinef686f5f.Trampoline a
136+
gen = Freef686f5f.suspendF <<< Trampolinef686f5f.done
137137

138138
bindsT :: Array Number -> Trampoline0df59c5.Trampoline Number
139139
bindsT as = foldl (\b a -> genT a >>= const b) (genT 0.0) as

benchmark/Benchmark/Trampoline326759a.purs renamed to benchmark/Benchmark/Trampolinef686f5f.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- | A _trampoline_ monad, which can be used at the bottom of
22
-- | a monad transformer stack to avoid stack overflows in large
33
-- | monadic computations.
4-
module Benchmark.Trampoline326759a
4+
module Benchmark.Trampolinef686f5f
55
( Trampoline
66
, done
77
, delay
@@ -10,7 +10,7 @@ module Benchmark.Trampoline326759a
1010

1111
import Prelude
1212

13-
import Benchmark.Free326759a (Free, liftF, runFree)
13+
import Benchmark.Freef686f5f (Free, liftF, runFree)
1414

1515
-- | The `Trampoline` monad
1616
-- |

0 commit comments

Comments
 (0)