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
go version
$ go version go version devel +a15b5d3092 Wed Dec 11 22:01:13 2019 +0000 linux/amd64
Yes.
go env
$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/xiaji01/.cache/go-build" GOENV="/home/xiaji01/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/xiaji01/.go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/home/xiaji01/src/bench/go.x86" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/xiaji01/src/bench/go.x86/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/xiaji01/src/bench/go.x86/src/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build896412687=/tmp/go-build -gno-record-gcc-switches"
go test -run=none -bench=PutUint encoding/binary goos: linux goarch: amd64 pkg: encoding/binary BenchmarkPutUint16-40 1000000000 0.558 ns/op 3585.32 MB/s BenchmarkPutUint32-40 1000000000 0.727 ns/op 5503.20 MB/s BenchmarkPutUint64-40 1000000000 0.865 ns/op 9251.43 MB/s BenchmarkLittleEndianPutUint16-40 1000000000 0.580 ns/op 3446.18 MB/s BenchmarkLittleEndianPutUint32-40 1000000000 0.612 ns/op 6537.16 MB/s BenchmarkLittleEndianPutUint64-40 1000000000 0.611 ns/op 13090.27 MB/s PASS ok encoding/binary 4.468s
encoding/binary.bigEndian.PutUint[16,32,64] and encoding/binary.littleEndian.PutUint[16,32,64] get executed and profiled.
They are optimized out by compile optimization.
The text was updated successfully, but these errors were encountered:
There isn't anything getting optimized out. That's the set of benchmarks that have been implemented. The benchmarks are not generated automatically. Look in encoding/binary/binary_test.go. Feel free to mail a CL that adds big endian versions.
encoding/binary/binary_test.go
Sorry, something went wrong.
Never mind, those benchmarks are there. They are the ones without LittleEndian in the names. What did you want to see exactly, again?
LittleEndian
Thanks @randall77, my bad, double checked SSA output and the code is not optimized out.
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go test -run=none -bench=PutUint encoding/binary
goos: linux
goarch: amd64
pkg: encoding/binary
BenchmarkPutUint16-40 1000000000 0.558 ns/op 3585.32 MB/s
BenchmarkPutUint32-40 1000000000 0.727 ns/op 5503.20 MB/s
BenchmarkPutUint64-40 1000000000 0.865 ns/op 9251.43 MB/s
BenchmarkLittleEndianPutUint16-40 1000000000 0.580 ns/op 3446.18 MB/s
BenchmarkLittleEndianPutUint32-40 1000000000 0.612 ns/op 6537.16 MB/s
BenchmarkLittleEndianPutUint64-40 1000000000 0.611 ns/op 13090.27 MB/s
PASS
ok encoding/binary 4.468s
What did you expect to see?
encoding/binary.bigEndian.PutUint[16,32,64] and encoding/binary.littleEndian.PutUint[16,32,64] get executed and profiled.
What did you see instead?
They are optimized out by compile optimization.
The text was updated successfully, but these errors were encountered: