New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/perf/benchstat: support piping results to benchstat #23896
Comments
Benchstat takes two files, how are you going to pipe the before and after output to it simultaneously?
… On 18 Feb 2018, at 08:24, Kevin Burke ***@***.***> wrote:
I just want human-readable output for the number of allocations and the time taken. Currently I write this in a Makefile:
BENCHSTAT := $(GOPATH)/bin/benchstat
$(BENCHSTAT):
go get -u golang.org/x/perf/cmd/benchstat
bench: $(BENCHSTAT)
tmp=$$(mktemp); go list ./... | grep -v vendor | xargs go test -benchtime=2s -bench=. -run='^$$' > "$$tmp" 2>&1 && $(BENCHSTAT) "$$tmp"
It would be simpler if you could pipe the results of go test -bench=. directly to benchstat, instead of having to send it to a file first.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
If you run benchstat with a single file input, it prints the outputs in human readable format. Example go test -bench output:
And the same file output run through benchstat:
Perhaps a better solution would be add a human-readable flag to |
We could also add a second command, |
Change https://golang.org/cl/94905 mentions this issue: |
Wow, TIL, thanks
… On 18 Feb 2018, at 08:47, GopherBot ***@***.***> wrote:
Change https://golang.org/cl/94905 mentions this issue: cmd/benchstat: Support input on stdin
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Replied on the CL; please use benchstat /dev/stdin for now. I don't think this is commonly needed enough to confuse people who just type 'benchstat'. |
ah, neat, I didn't know about the /dev/stdin trick! |
Alright, closing, fwiw I made github.com/kevinburke/humanbench to translate the benchmark results on the fly. |
I just want human-readable output for the number of allocations and the time taken. Currently I write this in a Makefile:
It would be simpler if you could pipe the results of
go test -bench=.
directly to benchstat, instead of having to send it to a file first.The text was updated successfully, but these errors were encountered: