Compiler can recognize the common:
construct and lower it into:
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