Go Benchpress is a visualisation utility for comparing the results of benchmarks.
Benchmarks are a really useful tool for comparing a couple of different strategies for achieving a goal, but also for an easy understanding of performance regressions within the system.
Sub-benchmarks are particularly useful for understanding how a particular feature operates over different data-set sizes.
Go Benchpress simplifies visualising these benchmark results - designed particularly for sub-benchmarks and demonstrating how your code performs at different data-set sizes - visually.
Go Benchpress outputs, by default, a file of results for each benchmark passed in (via the Benchmark result data).
This is so that sub-benchmarks can be compared more easily.
A second mode of operation exists - 'no separation'. This is where the results of all the passed in benchmarks are output into a single file.
You will find more information on the specifics of this in the CSV Parser package - the README contains detailed instructions on CLI usage, and how to make use of these different modes.
So, given Go Benchpress will either output a file for each benchmark, or a single file for all benchmarks, what formats are available?
Go Benchpress output can look like a variety of things.
Graphically, this is what a Go Benchpress output looks like:
As you can see, it compares all the results for a single benchmark (across its various sub-benchmarks), displaying their relative values visually.
You can choose between several dimensions (including nanoseconds per operation, bytes per operation, etc.) - for the most recent advice on this, please consult the help text using:
gobenchpress -help
There are also other formats to choose from - overall the following formats are supported:
- SVG (as a bar chart)
- PNG (as a bar chart)
- JSON
- CSV
- XML
See the example CSV Parser package for instructions on how to use different formats, and what they look like.
Run the following command at a terminal:
go get github.com/rpickz/go-benchpress/cmd/gobenchpress
See the example CSV Parser package for instructions on how to use.
For more detailed instructions, see the CLI usage info with the following:
gobenchpress -help
MIT License.