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

cmd/compile: performance regression in zeroing structs in 1.8 #19677

OneOfOne opened this issue Mar 23, 2017 · 1 comment


None yet
3 participants
Copy link

commented Mar 23, 2017

Please answer these questions before submitting your issue. Thanks!

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

1.7, 1.8 and tip

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


What did you do?


What did you expect to see?

Same performance as 1.7.x

What did you see instead?

2.5x slowdown, note that the performance hit doesn't exist on tip so that's good at least.


Go 1.7

➤ go17 version; go17 test -bench=. -benchtime=5s
go version go1.7.5 linux/amd64
testing: warning: no tests to run
BenchmarkZeroByHand-8           2000000000               2.86 ns/op
BenchmarkZeroByAssign-8         3000000000               2.58 ns/op

Go 1.8

➤ go18 version; go18 test -bench=. -benchtime=5s
go version go1.8 linux/amd64
BenchmarkZeroByHand-8           2000000000               2.80 ns/op
BenchmarkZeroByAssign-8         2000000000               4.95 ns/op

Go tip

➤ go version; go test -bench=. -benchtime=5s
go version devel +7ac2e413eb 2017-03-23 19:15:51 +0000 linux/amd64
goos: linux
goarch: amd64
BenchmarkZeroByHand-8           3000000000               2.80 ns/op
BenchmarkZeroByAssign-8         3000000000               2.51 ns/op

This comment has been minimized.

Copy link

commented Mar 23, 2017

Looks like it's fixed in tip, so we can close this bug.

This doesn't meet the strict requirements for minor release backport, so Go 1.8 will have to remain as it is.

@bradfitz bradfitz closed this Mar 23, 2017

@golang golang locked and limited conversation to collaborators Mar 23, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.