Skip to content

Commit 8f42a47

Browse files
sjakobitreeowl
authored andcommitted
Replace criterion with gauge as the benchmark framework
1 parent dcf16d4 commit 8f42a47

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
lines changed

benchmarks/IntMap.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Main where
33

44
import Control.DeepSeq (rnf)
55
import Control.Exception (evaluate)
6-
import Criterion.Main (bench, defaultMain, whnf)
6+
import Gauge (bench, defaultMain, whnf)
77
import Data.List (foldl')
88
import qualified Data.IntMap as M
99
import qualified Data.IntMap.Strict as MS

benchmarks/IntSet.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Main where
44

55
import Control.DeepSeq (rnf)
66
import Control.Exception (evaluate)
7-
import Criterion.Main (bench, defaultMain, whnf)
7+
import Gauge (bench, defaultMain, whnf)
88
import Data.List (foldl')
99
import qualified Data.IntSet as S
1010

benchmarks/LookupGE/IntMap.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Main where
33

44
import Control.DeepSeq (rnf)
55
import Control.Exception (evaluate)
6-
import Criterion.Main (bench, defaultMain, nf)
6+
import Gauge (bench, defaultMain, nf)
77
import Data.List (foldl')
88
import qualified Data.IntMap as M
99
import qualified LookupGE_IntMap as M

benchmarks/LookupGE/Map.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Main where
33

44
import Control.DeepSeq (rnf)
55
import Control.Exception (evaluate)
6-
import Criterion.Main (defaultMain, bench, nf)
6+
import Gauge (defaultMain, bench, nf)
77
import Data.List (foldl')
88
import qualified Data.Map as M
99
import qualified LookupGE_Map as M

benchmarks/Map.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Main where
55
import Control.Applicative (Const(Const, getConst), pure)
66
import Control.DeepSeq (rnf)
77
import Control.Exception (evaluate)
8-
import Criterion.Main (bench, defaultMain, whnf, nf)
8+
import Gauge (bench, defaultMain, whnf, nf)
99
import Data.Functor.Identity (Identity(..))
1010
import Data.List (foldl')
1111
import qualified Data.Map as M

benchmarks/Sequence.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Control.Applicative
44
import Control.DeepSeq (rnf)
55
import Control.Exception (evaluate)
66
import Control.Monad.Trans.State.Strict
7-
import Criterion.Main (bench, bgroup, defaultMain, nf)
7+
import Gauge (bench, bgroup, defaultMain, nf)
88
import Data.Foldable (foldl', foldr')
99
import qualified Data.Sequence as S
1010
import qualified Data.Foldable

benchmarks/Set.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Main where
44

55
import Control.DeepSeq (rnf)
66
import Control.Exception (evaluate)
7-
import Criterion.Main (bench, defaultMain, whnf)
7+
import Gauge (bench, defaultMain, whnf)
88
import Data.List (foldl')
99
import qualified Data.Set as S
1010

benchmarks/SetOperations/SetOperations.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module SetOperations (benchmark) where
44

5-
import Criterion.Main (bench, defaultMain, whnf)
5+
import Gauge (bench, defaultMain, whnf)
66
import Data.List (partition)
77

88
benchmark :: ([Int] -> container) -> Bool -> [(String, container -> container -> container)] -> IO ()

containers.cabal

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ benchmark intmap-benchmarks
103103
build-depends:
104104
base >= 4.6 && < 5,
105105
containers,
106-
criterion >= 0.4.0 && < 1.6,
106+
gauge >= 0.2.3 && < 0.3,
107107
deepseq >= 1.1.0.0 && < 1.5
108108

109109
benchmark intset-benchmarks
@@ -114,7 +114,7 @@ benchmark intset-benchmarks
114114
build-depends:
115115
base >= 4.6 && < 5,
116116
containers,
117-
criterion >= 0.4.0 && < 1.6,
117+
gauge >= 0.2.3 && < 0.3,
118118
deepseq >= 1.1.0.0 && < 1.5
119119

120120
benchmark map-benchmarks
@@ -125,7 +125,7 @@ benchmark map-benchmarks
125125
build-depends:
126126
base >= 4.6 && < 5,
127127
containers,
128-
criterion >= 0.4.0 && < 1.6,
128+
gauge >= 0.2.3 && < 0.3,
129129
deepseq >= 1.1.0.0 && < 1.5,
130130
transformers
131131

@@ -137,7 +137,7 @@ benchmark sequence-benchmarks
137137
build-depends:
138138
base >= 4.6 && < 5,
139139
containers,
140-
criterion >= 0.4.0 && < 1.6,
140+
gauge >= 0.2.3 && < 0.3,
141141
deepseq >= 1.1.0.0 && < 1.5,
142142
random < 1.2,
143143
transformers
@@ -150,7 +150,7 @@ benchmark set-benchmarks
150150
build-depends:
151151
base >= 4.6 && < 5,
152152
containers,
153-
criterion >= 0.4.0 && < 1.6,
153+
gauge >= 0.2.3 && < 0.3,
154154
deepseq >= 1.1.0.0 && < 1.5
155155

156156
benchmark set-operations-intmap
@@ -162,7 +162,7 @@ benchmark set-operations-intmap
162162
build-depends:
163163
base >= 4.6 && < 5,
164164
containers,
165-
criterion >= 0.4.0 && < 1.6
165+
gauge >= 0.2.3 && < 0.3
166166

167167
benchmark set-operations-intset
168168
type: exitcode-stdio-1.0
@@ -173,7 +173,7 @@ benchmark set-operations-intset
173173
build-depends:
174174
base >= 4.6 && < 5,
175175
containers,
176-
criterion >= 0.4.0 && < 1.6
176+
gauge >= 0.2.3 && < 0.3
177177

178178
benchmark set-operations-map
179179
type: exitcode-stdio-1.0
@@ -184,7 +184,7 @@ benchmark set-operations-map
184184
build-depends:
185185
base >= 4.6 && < 5,
186186
containers,
187-
criterion >= 0.4.0 && < 1.6
187+
gauge >= 0.2.3 && < 0.3
188188

189189
benchmark set-operations-set
190190
type: exitcode-stdio-1.0
@@ -195,7 +195,7 @@ benchmark set-operations-set
195195
build-depends:
196196
base >= 4.6 && < 5,
197197
containers,
198-
criterion >= 0.4.0 && < 1.6
198+
gauge >= 0.2.3 && < 0.3
199199

200200
benchmark lookupge-intmap
201201
type: exitcode-stdio-1.0
@@ -218,7 +218,7 @@ benchmark lookupge-intmap
218218
build-depends:
219219
base >= 4.6 && < 5,
220220
containers,
221-
criterion >= 0.4.0 && < 1.6,
221+
gauge >= 0.2.3 && < 0.3,
222222
deepseq >= 1.1.0.0 && < 1.5,
223223
ghc-prim
224224

@@ -247,7 +247,7 @@ benchmark lookupge-map
247247
build-depends:
248248
base >= 4.6 && < 5,
249249
containers,
250-
criterion >= 0.4.0 && < 1.6,
250+
gauge >= 0.2.3 && < 0.3,
251251
deepseq >= 1.1.0.0 && < 1.5,
252252
ghc-prim
253253

stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ packages:
44

55
### Uncoment the resolver you want to use and re-run `stack build/test/bench`.
66
# resolver: lts-10.0
7-
resolver: lts-9.20
7+
resolver: lts-12.13
88

99
### ChasingBottoms is only in Stackage snapshots lts-7.24 and below.
1010
extra-deps:

0 commit comments

Comments
 (0)