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
runtime: special case timer channels #8898
Comments
Comments about this bug are in https://go-review.googlesource.com/#/c/8356/ |
I intend to look into this for Go 1.7. I've started work on a CL. |
Note there is a caveat: if we have code like:
Currently we arm and install the timer once. If we special case timer channels, we will need to install and uninstall the timer for each select. |
@rsc is this going to make 1.8? |
Did not get to this. |
That seems like a disadvantage, not an advantage: it would encourage writing non-portable Go code (that is, programs which appear to work when using the Unless you're proposing to make a corresponding language change, in which case this seems like it needs to be a full-fledged proposal.
There is a more general version of this optimization which we might want to consider anyway. If we:
then we can (and arguably should) combine the struct and the referent into a single allocation. That optimization is more or less orthogonal to any special-casing for timer channels in |
This is now a duplicate of #61542. |
Change https://go.dev/cl/512355 mentions this issue: |
The text was updated successfully, but these errors were encountered: