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

compiler: replace coroutine.Yield calls with method call on coroutine context #97

Open
achille-roussel opened this issue Oct 2, 2023 · 0 comments
Labels
performance Performance improvements

Comments

@achille-roussel
Copy link
Contributor

The implementation of coroutine.Yiled is a call to coroutine.LoadContext followed by a call to the Yield method on the returned coroutine context. However, the generated coroutine code makes a call to coroutine.LoadContext when entering a function, in each coroutine the context is already available as a local variable, which means that we are making an extra call to coroutine.LoadContext in coroutine.Yield that could be replaced by a direct method call on the context that we already loaded.

@achille-roussel achille-roussel added the performance Performance improvements label Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance improvements
Projects
None yet
Development

No branches or pull requests

1 participant