miniterion 0.1.1.0 → 0.1.1.1
raw patch · 6 files changed
+42/−16 lines, 6 filessetup-changedPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−1
- README.md +13/−8
- Setup.hs +2/−0
- miniterion.cabal +8/−5
- src/Miniterion.hs +5/−1
- test/Main.hs +9/−1
CHANGELOG.md view
@@ -1,6 +1,10 @@ # Revision history for miniterion -## 0.1.1.0 -- 2023-09+## 0.1.1.1 -- 2024-05-29++* Suppress warning messages in ghc 9.10.++## 0.1.1.0 -- 2023-09-20 * Update version bounds of ``deepseq``.
README.md view
@@ -4,28 +4,30 @@ [![codecov][codecov-badge-svg]][codecov-badge-link] [![Hackage][hackage-badge]][hackage-package] [![Stackage LTS][stackage-lts-badge]][stackage-lts-package]+[![Stackage nightly][stackage-nightly-badge]][stackage-nightly-package] ## Summary Miniterion is a lightweight Haskell cabal package containing utilities for writing benchmark codes. The package has an API subset of-[`criterion`](criterion) package, so switching to other benchmark-packages ([`criterion`](criterion), [`gauge`](gauge), and-[`tasty-bench`](tasty-bench)) should be easily done.+[`criterion`][criterion] package, so switching to other benchmarking+packages ([`criterion`][criterion], [`gauge`][gauge], and+[`tasty-bench`][tasty-bench]) should be easily done. As in `criterion`, the executable built with the `defaultMain`-function supports selecting the running benchmarks with prefix match,+supports selecting the running benchmarks with prefix match, case insensitive prefix match, substring match, or glob pattern match via the command line option. Invoke the benchmark executable with `--help` option to see other available options. -## Philosophy+## Motivation The goal of the miniterion package is to have a reasonably useful and lightweight benchmarking utility with a small amount of maintenance-costs.+effort. For robust and feature-rich benchmarking utility, use the+other packages mentioned above. The miniterion package is designed to have a small number of package dependencies. At the time of writing, the dependency packages are only@@ -79,7 +81,7 @@ then compile and run the benchmark with `cabal bench`: -```+```console $ cabal bench Build profile: -w ghc-9.6.2 -O1 In order, the following will be built (use -v for more details):@@ -109,7 +111,7 @@ Run: -```+```console $ cabal run -- fibo --help ``` @@ -128,6 +130,9 @@ [stackage-lts-badge]: http://stackage.org/package/miniterion/badge/lts [stackage-lts-package]: http://stackage.org/lts/package/miniterion++[stackage-nightly-badge]: http://stackage.org/package/miniterion/badge/nightly+[stackage-nightly-package]: http://stackage.org/nightly/package/miniterion [criterion]: http://hackage.haskell.org/package/criterion [gauge]: http://hackage.haskell.org/package/gauge
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
miniterion.cabal view
@@ -8,9 +8,9 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.1.1.0+version: 0.1.1.1 -synopsis: Simple and lightweight benchmark utilities+synopsis: Simple and lightweight benchmarking utilities description: Simple benchmarking utilities with API subset of@@ -20,7 +20,7 @@ The goal of this package is to provide simple and lightweight benchmark utilities with less amount of codes and dependency- packages. For robust and feature rich benchmarking utility, use the+ packages. For robust and feature-rich benchmarking utility, use the other packages mentioned above. license: MIT@@ -35,8 +35,11 @@ extra-doc-files: CHANGELOG.md README.md -tested-with: GHC == 9.4.7- , GHC == 9.6.2+tested-with: GHC == 9.2.8+ , GHC == 9.4.8+ , GHC == 9.6.5+ , GHC == 9.8.2+ , GHC == 9.10.1 common basic build-depends: base >= 4.12 && < 5.0
src/Miniterion.hs view
@@ -69,7 +69,7 @@ throwIO) import Control.Monad (guard, replicateM, void, when) import Data.Char (toLower)-import Data.Foldable (find, foldl')+import Data.Foldable (find) import Data.Int (Int64) import Data.List (intercalate, isPrefixOf, nub, stripPrefix, tails)@@ -90,6 +90,10 @@ import System.Timeout (timeout) import Text.Printf (printf) import Text.Read (readMaybe)++#if !MIN_VERSION_base(4,20,0)+import Data.Foldable (foldl')+#endif #if MIN_VERSION_base(4,15,0) import GHC.Exts (SPEC (..))
test/Main.hs view
@@ -447,7 +447,15 @@ defaultMain' = defaultMainWith [] defaultMainWith :: [String] -> [Benchmark] -> IO ()-defaultMainWith args = withArgs args . Miniterion.defaultMain+defaultMainWith args = withArgs args' . Miniterion.defaultMain+ where+#if linux_HOST_OS+ -- Running the tests in CI for other os than Linux is slow, using+ -- higher value for stdev to speed.+ args' = args+#else+ args' = "--stdev=20" : args+#endif fib :: Int -> Integer fib n = if n < 2 then toInteger n else fib (n-1) + fib (n-2)