Skip to content

Commit c481228

Browse files
authored
Migrate benchmarks to tasty-bench (#338)
tasty-bench is more actively maintained and supported. gauge doesn't build with GHC 9.2 yet.
1 parent fdb6c1a commit c481228

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

.github/workflows/haskell-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
122122
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
123123
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
124-
if [ $((HCNUMVER < 90200)) -ne 0 ] ; then echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" ; else echo "ARG_BENCH=--disable-benchmarks" >> "$GITHUB_ENV" ; fi
124+
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
125125
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
126126
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
127127
echo "GHCJSARITH=0" >> "$GITHUB_ENV"

benchmarks/Benchmarks.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
module Main where
44

55
import Control.DeepSeq
6-
import Gauge (bench, bgroup, defaultMain, env, nf, whnf)
76
import Data.Bits ((.&.))
87
import Data.Functor.Identity
98
import Data.Hashable (Hashable, hash)
@@ -16,6 +15,7 @@ import Data.List (foldl')
1615
import Data.Maybe (fromMaybe)
1716
import GHC.Generics (Generic)
1817
import Prelude hiding (lookup)
18+
import Test.Tasty.Bench (bench, bgroup, defaultMain, env, nf, whnf)
1919

2020
import qualified Util.ByteString as UBS
2121
import qualified Util.Int as UI

cabal.haskell-ci

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
branches: master
44

5-
-- Due to https://github.com/haskell-foundation/foundation/issues/554 via gauge.
6-
benchmarks: <9.2
7-
85
constraint-set debug
96
constraints: unordered-containers +debug
107
tests: True

unordered-containers.cabal

+4-2
Original file line numberDiff line numberDiff line change
@@ -202,16 +202,18 @@ benchmark benchmarks
202202
base >= 4.8.0,
203203
bytestring >= 0.10.0.0,
204204
containers,
205-
gauge >= 0.2.5 && < 0.3,
206205
deepseq >= 1.4,
207206
hashable >= 1.0.1.1,
208207
hashmap,
209208
mtl,
210209
random,
210+
tasty-bench >= 0.3.1,
211211
unordered-containers
212212

213213
default-language: Haskell2010
214-
ghc-options: -Wall -O2 -rtsopts -fwarn-tabs -ferror-spans
214+
ghc-options: -Wall -O2 -rtsopts -with-rtsopts=-A32m
215+
if impl(ghc >= 8.10)
216+
ghc-options: "-with-rtsopts=-A32m --nonmoving-gc"
215217

216218
source-repository head
217219
type: git

0 commit comments

Comments
 (0)