Skip to content

GH-143732: SEND specialization#148963

Open
markshannon wants to merge 3 commits intopython:mainfrom
markshannon:send-specialization
Open

GH-143732: SEND specialization#148963
markshannon wants to merge 3 commits intopython:mainfrom
markshannon:send-specialization

Conversation

@markshannon
Copy link
Copy Markdown
Member

@markshannon markshannon commented Apr 24, 2026

Adds 2 new specialized instructions:

  • SEND_VIRTUAL for sends to virtual iterators e.g lists and tuples
  • SEND_ASYNC_GEN for sends to async generators

Also, tweaks FOR_ITER_VIRTUAL so that SEND_VIRTUAL and FOR_ITER_VIRTUAL use equivalent guards

This is aimed more at JIT coverage, especially ensuring that we can trace through SEND instructions, than interpreter performance.

Performance is broadly neutral, but with improvements of 4-6% on the async_generators benchmark.

* SEND_VIRTUAL: for sends to virtual iterators e.g lists and tuples
* SEND_ASYNC_GEN: for sends to async generators

Tweak FOR_ITER_VIRTUAL so that SEND_VIRTUAL and FOR_ITER_VIRTUAL use equivalent guards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant