benchstat: handle user-ns/op units

compilebench emits both ns/op and user-ns/op measurements.
This CL improves benchstat's handling of such measurements.
Migrated from https://github.com/rsc/benchstat/pull/5.

Sample output, before:

name       old user-ns/op  new user-ns/op  delta
Template        279M ± 7%       273M ± 4%     ~     (p=0.329 n=6+5)
Unicode         148M ±11%       131M ± 7%  -11.49%  (p=0.030 n=6+5)
GoTypes         830M ± 2%       835M ± 3%     ~     (p=0.792 n=6+5)
SSA            9.60G ± 3%      9.64G ± 2%     ~     (p=0.792 n=6+5)
Flate           158M ± 3%       155M ± 1%     ~     (p=0.329 n=6+5)
GoParser        204M ± 6%       202M ± 8%     ~     (p=0.792 n=6+5)
Reflect         511M ± 9%       531M ± 6%     ~     (p=0.177 n=6+5)
Tar             151M ± 3%       151M ± 5%     ~     (p=0.931 n=6+5)
XML             271M ± 3%       268M ± 3%     ~     (p=0.429 n=6+5)

Sample output, after:

name       old user-time/op  new user-time/op  delta
Template         279ms ± 7%        273ms ± 4%     ~     (p=0.329 n=6+5)
Unicode          148ms ±11%        131ms ± 7%  -11.49%  (p=0.030 n=6+5)
GoTypes          830ms ± 2%        835ms ± 3%     ~     (p=0.792 n=6+5)
SSA              9.60s ± 3%        9.64s ± 2%     ~     (p=0.792 n=6+5)
Flate            158ms ± 3%        155ms ± 1%     ~     (p=0.329 n=6+5)
GoParser         204ms ± 6%        202ms ± 8%     ~     (p=0.792 n=6+5)
Reflect          511ms ± 9%        531ms ± 6%     ~     (p=0.177 n=6+5)
Tar              151ms ± 3%        151ms ± 5%     ~     (p=0.931 n=6+5)
XML              271ms ± 3%        268ms ± 3%     ~     (p=0.429 n=6+5)

Change-Id: I716b4e89a28adc72e9135b8c580434f748a9c0a9
Reviewed-on: https://go-review.googlesource.com/39794
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Quentin Smith <quentin@golang.org>
6 files changed
tree: 3f1510a7846a82c02a936ca09749d2f39645ad19
  1. analysis/
  2. benchstat/
  3. cmd/
  4. internal/
  5. storage/
  6. vendor/
  7. AUTHORS
  8. CONTRIBUTING.md
  9. CONTRIBUTORS
  10. LICENSE
  11. PATENTS
  12. README.md
README.md

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 https://perfdata.golang.org/ benchmark result storage system.

analysis contains the https://perf.golang.org/ 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 golang.org/x/perf/storage/localperfdata
go get -u golang.org/x/perf/analysis/localperf
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 http://golang.org/doc/contribute.html.