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
in function runtime.retake(). It loads the length of allp from memory in each loop. If we store len(allp) in a variable and only update that variable after acquiring allpLock, those redundant loads can be eliminated.
The text was updated successfully, but these errors were encountered:
Thanks for your change. I don't think this function runs frequently enough for this optimization to show any meaningful difference in real applications, and in my opinion it makes the code less clear.
(In the future, please feel free to send small changes like this without filing an issue for it.)
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?
I ran Go programs with a tool that detects redundant loads.
What did you expect to see?
Few redundant loads.
What did you see instead?
There are about 20000-30000 redundant loads in a hello world program at instruction
that does the loop bounds checking at source line
in function runtime.retake(). It loads the length of allp from memory in each loop. If we store len(allp) in a variable and only update that variable after acquiring allpLock, those redundant loads can be eliminated.
The text was updated successfully, but these errors were encountered: