From c481228ed539aeeb4b19d11384a14a2831cd4b84 Mon Sep 17 00:00:00 2001 From: Simon Jakobi Date: Sun, 19 Dec 2021 18:15:53 +0100 Subject: [PATCH] Migrate benchmarks to tasty-bench (#338) tasty-bench is more actively maintained and supported. gauge doesn't build with GHC 9.2 yet. --- .github/workflows/haskell-ci.yml | 2 +- benchmarks/Benchmarks.hs | 2 +- cabal.haskell-ci | 3 --- unordered-containers.cabal | 6 ++++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 1f24273d..350168c3 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -121,7 +121,7 @@ jobs: HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" - if [ $((HCNUMVER < 90200)) -ne 0 ] ; then echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" ; else echo "ARG_BENCH=--disable-benchmarks" >> "$GITHUB_ENV" ; fi + echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" echo "HEADHACKAGE=false" >> "$GITHUB_ENV" echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" echo "GHCJSARITH=0" >> "$GITHUB_ENV" diff --git a/benchmarks/Benchmarks.hs b/benchmarks/Benchmarks.hs index 031aa643..605c1825 100644 --- a/benchmarks/Benchmarks.hs +++ b/benchmarks/Benchmarks.hs @@ -3,7 +3,6 @@ module Main where import Control.DeepSeq -import Gauge (bench, bgroup, defaultMain, env, nf, whnf) import Data.Bits ((.&.)) import Data.Functor.Identity import Data.Hashable (Hashable, hash) @@ -16,6 +15,7 @@ import Data.List (foldl') import Data.Maybe (fromMaybe) import GHC.Generics (Generic) import Prelude hiding (lookup) +import Test.Tasty.Bench (bench, bgroup, defaultMain, env, nf, whnf) import qualified Util.ByteString as UBS import qualified Util.Int as UI diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 04ec5f5e..8ce9b222 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -2,9 +2,6 @@ branches: master --- Due to https://github.com/haskell-foundation/foundation/issues/554 via gauge. -benchmarks: <9.2 - constraint-set debug constraints: unordered-containers +debug tests: True diff --git a/unordered-containers.cabal b/unordered-containers.cabal index d413e15e..b52052c4 100644 --- a/unordered-containers.cabal +++ b/unordered-containers.cabal @@ -202,16 +202,18 @@ benchmark benchmarks base >= 4.8.0, bytestring >= 0.10.0.0, containers, - gauge >= 0.2.5 && < 0.3, deepseq >= 1.4, hashable >= 1.0.1.1, hashmap, mtl, random, + tasty-bench >= 0.3.1, unordered-containers default-language: Haskell2010 - ghc-options: -Wall -O2 -rtsopts -fwarn-tabs -ferror-spans + ghc-options: -Wall -O2 -rtsopts -with-rtsopts=-A32m + if impl(ghc >= 8.10) + ghc-options: "-with-rtsopts=-A32m --nonmoving-gc" source-repository head type: git