benchstat: don't print sign for 0% when there is no change

When all samples are identical, instead of printing
+0.00%, print just 0.00%.

This is not just more accurate.
When benchmarking the compiler, one item of interest
is the impact on object file and executable sizes.
These can change by tiny amounts, below two sig figs.
However, the existence of any change is sometimes a cue
to the reader to investigate further.
This obviously should not be relied on,
but it is nevertheless a useful signal.

Change-Id: I1e5157a52fc47c6871ca87b0e9cff223f4fd43d9
Run-TryBot: Josh Bleecher Snyder <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Brad Fitzpatrick <>
5 files changed
tree: 5864ae4d12c1556254ef7c6fe9d4d11867ab0f88
  1. analysis/
  2. benchstat/
  3. cmd/
  4. internal/
  5. storage/
  6. vendor/

Go performance measurement, storage, and analysis tools

This subrepository holds the source for various packages and tools related to performance measurement, storage, and analysis.

cmd/benchstat contains a command-line tool that computes and compares statistics about benchmarks.

cmd/benchsave contains a command-line tool for publishing benchmark results.

storage contains the benchmark result storage system.

analysis contains the benchmark result analysis system.

Both storage and analysis can be run locally; the following commands will run the complete stack on your machine with an in-memory datastore.

go get -u
go get -u
localperfdata -addr=:8081 -view_url_base=http://localhost:8080/search?q=upload: &
localperf -addr=:8080 -storage=http://localhost:8081

The storage system is designed to have a standardized API, and we encourage additional analysis tools to be written against the API. A client can be found in the storage package.

Contributions to Go are appreciated. See