1- # quickbench
1+ # quickbench 1.0
22
33Quick & easy benchmarking of command-line programs.
44
5+ [ About] ( #about )
6+ | [ Examples] ( #examples )
7+ | [ Usage] ( #usage )
8+ | [ Related] ( #related-work )
9+
10+
511## About
612
7- This is a reboot of the simplebench benchmarking tool from the hledger
8- project. You can use it as a fancier "time" command for benchmarking
9- command-line programs, or as a haskell library (eg in package benchmark
10- suites).
13+ quickbench is an update and repackaging of a benchmarking tool I've been
14+ using in the hledger project since 2008.
15+ Use it like a more powerful "time" command for benchmarking general command-line programs,
16+ or for creating repeatable benchmark scripts for your projects.
1117
12- quickbench is not smart or complicated like "bench" or criterion; it is
13- good for quick and dirty, exploratory, comparative measurements
14- that you can run quickly and understand at a glance.
15- I find it very useful; patches welcome!
18+ quickbench produces very simple output (elapsed seconds),
19+ as quickly as possible (running commands just once by default),
20+ and tabulates results from multiple executables.
21+ I find it very useful for quick and dirty, exploratory, and comparative measurements
22+ that I (and others) can understand at a glance.
1623
1724## Examples
1825
26+ Install it easily on most platforms with [ stack] ( https://haskell-lang.org/get-started ) (or cabal).
27+ It's not yet on Hackage, so you'll need the source:
28+
1929``` bash
2030$ git clone https://github.com/simonmichael/quickbench.git
2131$ cd quickbench
@@ -35,7 +45,8 @@ Best times:
3545+---------++------+
3646```
3747
38- or in a file.. ` bench.sh ` will be used by default:
48+ or put them in a file and use ` -f FILE ` .
49+ A file named ` bench.sh ` in the current directory will be used automatically:
3950```
4051$ echo 'echo 3 * 1000000' > bench.sh
4152$ quickbench
@@ -62,7 +73,8 @@ Best times:
6273+-------------++---------+---------+
6374```
6475
65- and repeat tests to reduce and evaluate jitter:
76+ and run tests repeatedly to reduce or observe jitter.
77+ (quickbench assumes the quickest measurement is the truest one):
6678```
6779$ quickbench -w echo,expr -p5 -n100 -N2
6880Running 1 tests 100 times with 2 executables at 2016-10-16 23:57:34.387764 UTC:
@@ -155,3 +167,25 @@ Options:
155167 -h, --help show this help
156168```
157169
170+ ## Related
171+
172+ [ bench] ( https://github.com/Gabriel439/bench#readme ) (Gabriel Gonzalez 2016) is another
173+ command line benchmarking tool written in Haskell.
174+ Use that one if you need detailed statistical analysis and output, or HTML reports.
175+ Here is bench's output for the echo/expr example above:
176+ ```
177+ $ bench 'echo 3 * 1000000'; bench 'expr 3 \* 1000000'
178+ benchmarking echo 3 * 1000000
179+ time 2.215 ms (2.173 ms .. 2.250 ms)
180+ 0.995 R² (0.989 R² .. 0.998 R²)
181+ mean 2.238 ms (2.203 ms .. 2.296 ms)
182+ std dev 147.6 μs (92.84 μs .. 265.3 μs)
183+ variance introduced by outliers: 48% (moderately inflated)
184+
185+ benchmarking expr 3 \* 1000000
186+ time 3.484 ms (3.405 ms .. 3.556 ms)
187+ 0.994 R² (0.987 R² .. 0.998 R²)
188+ mean 3.564 ms (3.497 ms .. 3.684 ms)
189+ std dev 280.3 μs (178.0 μs .. 494.9 μs)
190+ variance introduced by outliers: 52% (severely inflated)
191+ ```
0 commit comments