You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your code has a busy wait in the sched.Wait function. Don't use busy waits in Go. They behave badly.
If I change your loop to call runtime.Gosched--still a busy wait, but at least slightly less busy--then the benchmark results are comparable to 1.13.
And actually your comment "With function call, no need for runtime.Gosched()" is incorrect. The tip compiler is better about inlining, so there may not be any function calls there at all. I didn't check that, though.
@ianlancetaylor Are you suggesting the performance drop caused by new changes to the inlining? Why the new async preemption didn't work out for the busy-wait?
@changkun I think that is a possibility to consider. If I'm right, then the async preemption did kick in; that would be why the test passes at all. But I might also be wrong, and it might be something else, like the new timer code.
In any case, I don't think there is any bug to fix here in the Go toolchain. We aren't going to make any promises about the performance of a busy wait loop.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, it is reproducible in the current master branch(6dc250f).
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Performance improvements or fair performance changes.
What did you see instead?
The text was updated successfully, but these errors were encountered: