https://github.com/kevinburke/humanbench
Human-readable benchmark output
https://github.com/kevinburke/humanbench
benchmark golang testing
Last synced: over 1 year ago
JSON representation
Human-readable benchmark output
- Host: GitHub
- URL: https://github.com/kevinburke/humanbench
- Owner: kevinburke
- Created: 2018-02-19T06:14:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-19T17:16:56.000Z (over 8 years ago)
- Last Synced: 2025-01-29T12:47:30.206Z (over 1 year ago)
- Topics: benchmark, golang, testing
- Language: Go
- Size: 7.81 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# github.com/kevinburke/humanbench
Humanbench prints human-readable Go benchmarks. If your benchmark takes
milliseconds or minutes, humanbench will print `ms/op` or `min/op` instead of
`ns/op`.
### Usage
Put `humanbench` in front of the normal Go benchmark invocation (or any Go test
invocation). Rows printed to stdout that begin with "Benchmark" will be
reprinted using human-readable benchmarks.
```
humanbench go test -bench=.
```
I may add a version that you can pipe to, e.g. `go test | humanbench`, though
I worry. If `go test` exits 1, I don't have a reliable way of determining that
in the piped script, besides parsing the exit status text. This may lead people
to believe that their tests passed, when they didn't.
(You are supposed to set `bash -o pipefail` though few people do that).
### Installation
```
go get -u github.com/kevinburke/humanbench`
```