-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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 on append-like loop #19633
Comments
The regression was introduced in CL 36205 (cmd/internal/obj: remove Follow pass). Also see: #18977. cc @cherrymui |
Tried on two machines, one Linux desktop and one Mac laptop, the regression I saw is much smaller
So this is probably very processor-dependent? Assembly for tip:
Assembly for Go 1.8:
Seems the only difference is that on tip we make an unconditional jump for loop backedge ( @dr2chase made @dr2chase is also working on loop unrolling, which may help from a different direction. I guess we still don't want to copy instructions in the assembler? |
What I'm seeing is +50% (the benchmark above) on a Sandy bridge i5; but only +8% on a Haswell i7. Looks like it hits hard on Sandy Bridge (2nd gen), while from 4th gen and above is not that bad? I don't have any 3rd gen (Ivy bridge) to check there. |
CL https://golang.org/cl/38431 mentions this issue. |
Benchmark result on pretty recent 6th-gen i7 (i7-6600U) on linux/amd64 for go18 and gotip (
So here it is also ~ 50% slowdown. |
Consider the following benchmark:
Comparing tip (
go version devel +d972dc2de9 Tue Mar 21 06:36:56 2017 +0000 linux/amd64
) with go1.8 I get, on my machine:A pretty bad regression.
The text was updated successfully, but these errors were encountered: