quickbench
Release
1.0

Release
1.0

quickbench produces very simple output (elapsed seconds),
as quickly as possible (running commands just once by default),
and tabulates results from multiple executables.
I find it very useful for quick and dirty, exploratory, and comparative measurements
that you can understand at a glance.
Please see the readme for more.

Documentation

quickbench 1.0

About

quickbench is an update and repackaging of a little benchmarking tool I've been
using in the hledger project since 2008.
Use it like a more powerful "time" command for measuring the time taken by command-line programs,
or for creating repeatable benchmark scripts for your projects.

quickbench produces very simple output (elapsed seconds),
as quickly as possible (running commands just once by default),
and tabulates results from multiple executables.
I find it very useful for quick and dirty, exploratory, and comparative measurements
that you can understand at a glance.

Examples

Install it easily on most platforms with stack (or cabal).
It's not yet on Hackage, so you'll need the source:

Usage

$ quickbench -h
quickbench 1.0
Run some test commands, possibly with different executables, once or more
and show their best execution times.
Commands are specified as one or more quote-enclosed arguments,
and/or one per line in CMDSFILE; or read from a default file [./bench.sh].
With -w, commands' first words are replaced with a new executable
(or multiple comma-separated executables, showing times for all).
Note: tests executable files only, not shell builtins; options must precede args.
Usage:
quickbench [options] [<cmd>...]
Options:
-f, --file CMDSFILE file containing commands, one per line (- for stdin)
-w, --with EXE[,...] replace first word of commands with these executables
-n, --iterations=N run each test this many times [default: 1]
-N, --cycles=N run the whole suite this many times [default: 1]
-p, --precision=N show times with this many decimal places [default: 2]
-v, --verbose show commands being run
-V, --more-verbose show command output
--debug show debug output for this program
-h, --help show this help

Related

bench (Gabriel Gonzalez 2016) is another
command line benchmarking tool written in Haskell.
Use that one if you need detailed statistical analysis and output, or HTML reports.
Here is bench's output for the echo/expr example above: