Skip to content

Async statemachine optimisation #623

Description

@tomassedovic
Metadata
Point of contact @diondokter
Team(s) compiler
Goal document 2026/async-statemachine-optimisation

Summary

Add optimisations to the coroutine MIR transform to elide or simplify the generated statemachines.

This will help both async futures and generators.

Note: This has some overlap with this other proposal.
I'm not trying to usurp the issue. I was working on it incidentally at the same time and noticed very late that proposal already existed.

Tasks and status


Note: we have updated the body to match the 2026 goal. Your original text is preserved below.

Details

Metadata
Point of contact @diondokter
Team(s) compiler
Goal document 2026/async-statemachine-optimisation

Summary

Add optimisations to the coroutine MIR transform to elide or simplify the generated statemachines.

This will help both async futures and generators.

Note: This has some overlap with this other proposal.
I'm not trying to usurp the issue. I was working on it incidentally at the same time and noticed very late that proposal already existed.

Tasks and status

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions