Skip to content

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

@achille-roussel

Description

@achille-roussel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions