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
Compiler can recognize the common:
case <-time.After(x):
construct and lower it into:
runtime.selectrecvafter(x)
Runtime can handle this case much more efficiently: no need to create Timer, chan and
arm timers; it just needs to do a timed park of the goroutine until x. As a bonus, the
timer does not leak.
The text was updated successfully, but these errors were encountered:
I agree that this is related to issue #8898, and 8898 will somewhat alleviate benefit
from this optimization.
But this is still somewhat orthogonal thing, as in this case we don't even allocate nor
generate garbage.
The text was updated successfully, but these errors were encountered: