Skip to content
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: no output when parsing go test results on windows #61247

Closed
brandondube opened this issue Jul 9, 2023 · 3 comments
Closed
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@brandondube
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.20.2 windows/amd64

and

$ go install golang.org/x/perf/cmd/benchstat@latest
go: downloading golang.org/x/perf v0.0.0-20230427221525-d343f6398b76

Does this issue reproduce with the latest release?

did not test

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\brand\AppData\Local\go-build
set GOENV=C:\Users\brand\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\brand\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\brand\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.20.2
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=C:\Users\brand\src\pctl\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\brand\AppData\Local\Temp\go-build2102171391=/tmp/go-build -gno-record-gcc-switches

What did you do?

clone https://github.com/brandondube/pctl

in the root pctl folder, go test -count=10 -bench . > bench.txt

This produces the file:

bench.txt
goos: windows
goarch: amd64
pkg: github.com/brandondube/pctl
cpu: AMD Ryzen 9 7950X 16-Core Processor
BenchmarkPIDLoop-32       	556910445	         2.134 ns/op
BenchmarkPIDLoop-32       	536436079	         2.128 ns/op
BenchmarkPIDLoop-32       	543744961	         2.150 ns/op
BenchmarkPIDLoop-32       	571188943	         2.144 ns/op
BenchmarkPIDLoop-32       	553921231	         2.130 ns/op
BenchmarkPIDLoop-32       	560300208	         2.133 ns/op
BenchmarkPIDLoop-32       	557006866	         2.137 ns/op
BenchmarkPIDLoop-32       	568716604	         2.163 ns/op
BenchmarkPIDLoop-32       	548276173	         2.141 ns/op
BenchmarkPIDLoop-32       	560737706	         2.141 ns/op
BenchmarkLPF-32           	372365629	         3.234 ns/op
BenchmarkLPF-32           	365019788	         3.225 ns/op
BenchmarkLPF-32           	362279024	         3.224 ns/op
BenchmarkLPF-32           	368677864	         3.257 ns/op
BenchmarkLPF-32           	363842319	         3.297 ns/op
BenchmarkLPF-32           	363315544	         3.260 ns/op
BenchmarkLPF-32           	372020348	         3.296 ns/op
BenchmarkLPF-32           	366008430	         3.324 ns/op
BenchmarkLPF-32           	362339845	         3.277 ns/op
BenchmarkLPF-32           	362009732	         3.238 ns/op
BenchmarkHPF-32           	451668122	         2.683 ns/op
BenchmarkHPF-32           	436226106	         2.693 ns/op
BenchmarkHPF-32           	462930814	         2.696 ns/op
BenchmarkHPF-32           	451433809	         2.685 ns/op
BenchmarkHPF-32           	450776010	         2.718 ns/op
BenchmarkHPF-32           	440844540	         2.689 ns/op
BenchmarkHPF-32           	440125185	         2.668 ns/op
BenchmarkHPF-32           	445756618	         2.670 ns/op
BenchmarkHPF-32           	440521033	         2.686 ns/op
BenchmarkHPF-32           	443193980	         2.692 ns/op
BenchmarkBiquad-32        	368877667	         3.200 ns/op
BenchmarkBiquad-32        	372806614	         3.208 ns/op
BenchmarkBiquad-32        	374070783	         3.192 ns/op
BenchmarkBiquad-32        	374509742	         3.212 ns/op
BenchmarkBiquad-32        	372645230	         3.209 ns/op
BenchmarkBiquad-32        	373663568	         3.216 ns/op
BenchmarkBiquad-32        	374019950	         3.244 ns/op
BenchmarkBiquad-32        	375003984	         3.215 ns/op
BenchmarkBiquad-32        	362629900	         3.225 ns/op
BenchmarkBiquad-32        	362400795	         3.225 ns/op
BenchmarkStateSpace-32    	163445652	         7.359 ns/op
BenchmarkStateSpace-32    	163384921	         7.364 ns/op
BenchmarkStateSpace-32    	160790014	         7.354 ns/op
BenchmarkStateSpace-32    	163293565	         7.367 ns/op
BenchmarkStateSpace-32    	161149338	         7.352 ns/op
BenchmarkStateSpace-32    	163366044	         7.362 ns/op
BenchmarkStateSpace-32    	162739160	         7.326 ns/op
BenchmarkStateSpace-32    	161796784	         7.374 ns/op
BenchmarkStateSpace-32    	162368193	         7.358 ns/op
BenchmarkStateSpace-32    	161850598	         7.452 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1794 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1817 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1905 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1809 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1886 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1805 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1835 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1915 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1816 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1825 ns/op
BenchmarkFIRFilter-32     	175447726	         6.813 ns/op
BenchmarkFIRFilter-32     	176195204	         6.780 ns/op
BenchmarkFIRFilter-32     	178611482	         6.745 ns/op
BenchmarkFIRFilter-32     	180126871	         6.712 ns/op
BenchmarkFIRFilter-32     	176791880	         6.778 ns/op
BenchmarkFIRFilter-32     	175960251	         6.728 ns/op
BenchmarkFIRFilter-32     	177647713	         6.894 ns/op
BenchmarkFIRFilter-32     	176275880	         6.847 ns/op
BenchmarkFIRFilter-32     	173582355	         6.729 ns/op
BenchmarkFIRFilter-32     	175104055	         6.705 ns/op
PASS
ok  	github.com/brandondube/pctl	99.668s


The line endings are CRLF, but changing them to LF does not change the behavior of benchstat.

After doing so, invoke benchstat:

benchstat bench.txt

This produces a null output, and benchstat's return code is 0. I expected to see the usual benchstat output.

Running the same benchmark on windows subsystem for linux, with go 1.20.5, produces the file

bench.txt
goos: linux
goarch: amd64
pkg: github.com/brandondube/pctl
cpu: AMD Ryzen 9 7950X 16-Core Processor            
BenchmarkPIDLoop-32       	556950556	         2.167 ns/op
BenchmarkPIDLoop-32       	557676615	         2.193 ns/op
BenchmarkPIDLoop-32       	553675562	         2.170 ns/op
BenchmarkPIDLoop-32       	546509467	         2.147 ns/op
BenchmarkPIDLoop-32       	557190387	         2.201 ns/op
BenchmarkPIDLoop-32       	543512101	         2.203 ns/op
BenchmarkPIDLoop-32       	548559962	         2.174 ns/op
BenchmarkPIDLoop-32       	557450202	         2.139 ns/op
BenchmarkPIDLoop-32       	564419833	         2.128 ns/op
BenchmarkPIDLoop-32       	561758073	         2.146 ns/op
BenchmarkLPF-32           	377603649	         3.202 ns/op
BenchmarkLPF-32           	374204203	         3.190 ns/op
BenchmarkLPF-32           	371718177	         3.194 ns/op
BenchmarkLPF-32           	373730676	         3.205 ns/op
BenchmarkLPF-32           	374568943	         3.181 ns/op
BenchmarkLPF-32           	375112218	         3.185 ns/op
BenchmarkLPF-32           	376773606	         3.186 ns/op
BenchmarkLPF-32           	376786018	         3.187 ns/op
BenchmarkLPF-32           	377499621	         3.189 ns/op
BenchmarkLPF-32           	376156272	         3.192 ns/op
BenchmarkHPF-32           	452945294	         2.656 ns/op
BenchmarkHPF-32           	450845560	         2.643 ns/op
BenchmarkHPF-32           	452651097	         2.653 ns/op
BenchmarkHPF-32           	453425650	         2.648 ns/op
BenchmarkHPF-32           	452481432	         2.654 ns/op
BenchmarkHPF-32           	451396864	         2.654 ns/op
BenchmarkHPF-32           	451599208	         2.656 ns/op
BenchmarkHPF-32           	451884454	         2.651 ns/op
BenchmarkHPF-32           	451845573	         2.644 ns/op
BenchmarkHPF-32           	449351928	         2.656 ns/op
BenchmarkBiquad-32        	377297011	         3.183 ns/op
BenchmarkBiquad-32        	374881530	         3.189 ns/op
BenchmarkBiquad-32        	376649973	         3.194 ns/op
BenchmarkBiquad-32        	374645312	         3.192 ns/op
BenchmarkBiquad-32        	377104418	         3.184 ns/op
BenchmarkBiquad-32        	374657930	         3.185 ns/op
BenchmarkBiquad-32        	377005658	         3.182 ns/op
BenchmarkBiquad-32        	375266190	         3.193 ns/op
BenchmarkBiquad-32        	375875184	         3.197 ns/op
BenchmarkBiquad-32        	374370884	         3.248 ns/op
BenchmarkStateSpace-32    	163193721	         7.396 ns/op
BenchmarkStateSpace-32    	164258181	         7.300 ns/op
BenchmarkStateSpace-32    	164072041	         7.315 ns/op
BenchmarkStateSpace-32    	163204105	         7.285 ns/op
BenchmarkStateSpace-32    	164398299	         7.293 ns/op
BenchmarkStateSpace-32    	164617305	         7.301 ns/op
BenchmarkStateSpace-32    	164586385	         7.280 ns/op
BenchmarkStateSpace-32    	164607597	         7.317 ns/op
BenchmarkStateSpace-32    	163880760	         7.356 ns/op
BenchmarkStateSpace-32    	164462554	         7.301 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1800 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1826 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1817 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1794 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1803 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1824 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1813 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1795 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1797 ns/op
BenchmarkSetpoint-32      	1000000000	         0.1797 ns/op
BenchmarkFIRFilter-32     	175677933	         7.127 ns/op
BenchmarkFIRFilter-32     	162187520	         6.941 ns/op
BenchmarkFIRFilter-32     	164319968	         7.097 ns/op
BenchmarkFIRFilter-32     	170883248	         6.911 ns/op
BenchmarkFIRFilter-32     	171958609	         6.944 ns/op
BenchmarkFIRFilter-32     	176170941	         6.868 ns/op
BenchmarkFIRFilter-32     	176384228	         6.824 ns/op
BenchmarkFIRFilter-32     	176330742	         6.989 ns/op
BenchmarkFIRFilter-32     	176533140	         7.012 ns/op
BenchmarkFIRFilter-32     	162067396	         6.942 ns/op
PASS
ok  	github.com/brandondube/pctl	99.844s

with LF line endings. Benchstat produces the expected output in this case, regardless of whether it is called from Windows or WSL:

$ benchstat bench.txt # no output, returns 0
$ benchstat benchwsl.txt
goos: linux
goarch: amd64
pkg: github.com/brandondube/pctl
cpu: AMD Ryzen 9 7950X 16-Core Processor
              │ benchwsl.txt │
              │    sec/op    │
PIDLoop-32       2.168n ± 1%
LPF-32           3.190n ± 0%
HPF-32           2.654n ± 0%
Biquad-32        3.191n ± 0%
StateSpace-32    7.301n ± 1%
Setpoint-32     0.1801n ± 1%
FIRFilter-32     6.943n ± 2%
geomean          2.453n
@seankhliao
Copy link
Member

is this #58576

@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jul 9, 2023
@bcmills bcmills changed the title go test output seems incompatible with x/perf/benchstat on windows x/perf/benchstat: no output when parsing go test results on windows Jul 10, 2023
@gopherbot gopherbot added this to the Unreleased milestone Jul 10, 2023
@bcmills
Copy link
Contributor

bcmills commented Jul 10, 2023

(CC @golang/windows)

@bcmills bcmills added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jul 10, 2023
@brandondube
Copy link
Author

It appears to be the same as #58576 yes; thanks!

@golang golang locked and limited conversation to collaborators Jul 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants