go: cmd/compile: go1.7beta2 performance regression
Please answer these questions before submitting your issue. Thanks!
- What version of Go are you using (
go version)?
go version go1.6.2 darwin/amd64 go version go1.7beta2 darwin/amd64
- What operating system and processor architecture are you using (
go env)?
Intel i7-3540M (also tried on i7-2677M but didn’t see the same regression)
GOARCH=“amd64” GOHOSTARCH=“amd64” GOHOSTOS=“darwin” GOOS=“darwin” CC=“clang” GOGCCFLAGS=“-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common” CXX=“clang++” CGO_ENABLED=“1”
GOARCH=“amd64” GOHOSTARCH=“amd64” GOHOSTOS=“darwin” GOOS=“darwin” CC=“clang” GOGCCFLAGS=“-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/30/6hyj4x_x783f12hmbcmn5tt00000gn/T/go-build183604977=/tmp/go-build -gno-record-gcc-switches -fno-common” CXX=“clang++” CGO_ENABLED=“1”
- What did you do?
https://play.golang.org/p/3WDEr-_QZR
Disassembly (-gcflags -S): https://gist.github.com/samuel/3053bafe149a0459322f6eeaf8bd5ae5
- What did you expect to see?
Go 1.7beta2 the same performance or better than Go 1.6
- What did you see instead?
benchmark old ns/op new ns/op delta BenchmarkVScaleF32-4 2906 3801 +30.80% BenchmarkVMaxF32-4 2682 3951 +47.32%
benchmark old MB/s new MB/s speedup BenchmarkVScaleF32-4 1409.19 1077.37 0.76x BenchmarkVMaxF32-4 1527.02 1036.64 0.68x
About this issue
- Original URL
- State: open
- Created 8 years ago
- Comments: 15 (13 by maintainers)
I can’t access playground link (Forbidden), so I couldn’t build it myself and play with code/check perf counters. At a glance it looks like tip version make ucomiss always depend on previous iteration (X0 is always modified)
I confess I have no idea what is going on here. @TocarIP 1.6 disassembly:
tip disassembly:
Yet tip is 28% slower. For no discernible reason I can see.
Max is even worse. go1.6:
tip:
Tip has 1 extra reg->reg move, yet it is 2.3x slower! 2.3x people. You could compute Max twice using 1.6 and still have some time left over. What the heck is going on? (I tried MOVUPS->MOVSS, didn’t help.)