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?
to your account
go test -run=NONE -bench=Mutex sync
Middle column aligned.
~ ¶ go test -run=NONE -bench=Mutex sync
BenchmarkMutexUncontended-4 100000000 11.3 ns/op
BenchmarkMutex-4 10000000 111 ns/op
BenchmarkMutexSlack-4 10000000 207 ns/op
BenchmarkMutexWork-4 10000000 139 ns/op
BenchmarkMutexWorkSlack-4 5000000 213 ns/op
BenchmarkMutexNoSpin-4 2000000 777 ns/op
BenchmarkMutexSpin-4 500000 3450 ns/op
BenchmarkRWMutexUncontended-4 30000000 43.7 ns/op
BenchmarkRWMutexWrite100-4 20000000 75.2 ns/op
BenchmarkRWMutexWrite10-4 20000000 116 ns/op
BenchmarkRWMutexWorkWrite100-4 10000000 190 ns/op
BenchmarkRWMutexWorkWrite10-4 3000000 416 ns/op
ok sync 20.832s
Note how the first line for BenchmarkMutexUncontended breaks alignment since 100M run count doesn't fit %8d format defined here:
8475832 introduced scaling of ns/op reported to 0.01ns, but for such small numbers cycle count may not fit 8 symbols, so maybe it's worth increasing width to 9-10 digits?
go version go1.9.1 darwin/amd64
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/lb/3rk8rqs53czgb4v35w_342xc0000gn/T/go-build603696847=/tmp/go-build -gno-record-gcc-switches -fno-common"
GOROOT/bin/go version: go version go1.9.1 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.9.1
uname -v: Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64
ProductName: Mac OS X
lldb --version: lldb-900.0.45
The text was updated successfully, but these errors were encountered:
Why NeedsFix? It's a minor cosmetic issue whose solution is disproportionate to its severity.
Sorry, something went wrong.
It's OK with me if you just want to close it.
The solution would require implementing a columnator in the testing package, or using something like tabwriter, but that would destroy the dependency tree for the package.
If you care about alignment, I suggest taking https://github.com/robpike/tab/blob/master/main.go plus a little work to turn the spaces into tabs before passing the text to tabwriter.
If you want numeric alignment, it's even more work though.
Successfully merging a pull request may close this issue.