Skip to content
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: improve performance of channel closing without considering receivers #52067

champly opened this issue Mar 31, 2022 · 1 comment
NeedsInvestigation Performance


Copy link

@champly champly commented Mar 31, 2022

Because closechan will wake up all receivers and senders(will trigger panic). And after chansend acquires the lock again, if it judged that the channel has been closed, the panic will also be triggered, so when chanrecv is performed, it can be skipped to judge whether there is a waiting sender, thereby improving performance.

Copy link

@gopherbot gopherbot commented Mar 31, 2022

Change mentions this issue: runtime/chan.go: improve closed channel receive performance

@cherrymui cherrymui added this to the Unplanned milestone Apr 5, 2022
@cherrymui cherrymui changed the title runtime: closed channel can improve performance without considering receivers runtime: improve performance of channel closing without considering receivers Apr 5, 2022
@cherrymui cherrymui added the NeedsInvestigation label Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
NeedsInvestigation Performance
None yet

Successfully merging a pull request may close this issue.

4 participants