diff --git a/README.md b/README.md index 5beef6c..f42bb3a 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ and between benchmarks. - [Isolating interfering benchmarks](#isolating-interfering-benchmarks) - [Comparison against baseline](#comparison-against-baseline) - [Comparison between benchmarks](#comparison-between-benchmarks) +- [Plotting results](#plotting-results) - [Command-line options](#command-line-options) @@ -471,6 +472,15 @@ bcompare "$NF == \"tenth\" && $(NF-1) == \"fibonacci numbers\"" is a more robust choice of an [`awk` pattern](https://github.com/feuerbach/tasty#patterns) here. +## Plotting results + +Users can dump results into CSV with `--csv FILE` +and plot them using `gnuplot` or other software. But for convenience +there is also a built-in quick-and-dirty SVG plotting feature, +which can be invoked by passing `--svg FILE`. Here is a sample of its output: + +![Plotting](./example.svg) + ## Command-line options Use `--help` to list command-line options. @@ -510,3 +520,7 @@ Use `--help` to list command-line options. Upper bounds of acceptable slow down / speed up in percents. If a benchmark is unacceptably slower / faster than baseline (see `--baseline`), it will be reported as failed. Can be used in conjunction with a standard `tasty` option `--hide-successes` to show only problematic benchmarks. + +* `--svg` + + File to plot results in SVG format. diff --git a/Test/Tasty/Bench.hs b/Test/Tasty/Bench.hs index aded02e..c336cfa 100644 --- a/Test/Tasty/Bench.hs +++ b/Test/Tasty/Bench.hs @@ -423,6 +423,15 @@ Locating a baseline benchmark in larger suites could get tricky; is a more robust choice of an here. +=== Plotting results + +Users can dump results into CSV with @--csv@ @FILE@ and plot them using +@gnuplot@ or other software. But for convenience there is also a +built-in quick-and-dirty SVG plotting feature, which can be invoked by +passing @--svg@ @FILE@. Here is a sample of its output: + +![Plotting](example.svg) + === Command-line options Use @--help@ to list command-line options. @@ -468,6 +477,10 @@ Use @--help@ to list command-line options. conjunction with a standard @tasty@ option @--hide-successes@ to show only problematic benchmarks. +[@--svg@]: + + File to plot results in SVG format. + -} {-# LANGUAGE CPP #-} diff --git a/example.svg b/example.svg new file mode 100644 index 0000000..a8b6e35 --- /dev/null +++ b/example.svg @@ -0,0 +1,49 @@ + + + +Inversion.Data.Mod +353 ms + + +353 ms ± 47 ms + + + + + + +Inversion.Data.Mod.Word 294 ms + +294 ms ± 43 ms + + + + + + + +Inversion.finite-field +1.03 s + + +1.03 s ± 147 ms + + + + + + + +Inversion.modular-arithmetic +896 ms + + +896 ms ± 58 ms + + + + + + + + diff --git a/tasty-bench.cabal b/tasty-bench.cabal index f31150c..6b572a8 100644 --- a/tasty-bench.cabal +++ b/tasty-bench.cabal @@ -1,6 +1,6 @@ name: tasty-bench version: 0.2.3 -cabal-version: >=1.10 +cabal-version: 1.18 build-type: Simple license: MIT license-file: LICENSE @@ -20,6 +20,8 @@ description: extra-source-files: changelog.md README.md +extra-doc-files: + example.svg tested-with: GHC==9.0.1, GHC==8.10.4, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4