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

Closed
champly opened this issue Mar 31, 2022 · 1 comment
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Performance
Milestone

Comments

@champly
Copy link
Contributor

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.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/396884 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 Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 5, 2022
@golang golang locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants