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

Enable specialization of iteration over generators, for gen():, and awaiting coroutines, await coro() #96793

Closed
4 tasks done
markshannon opened this issue Sep 13, 2022 · 0 comments
Labels
performance Performance or resource usage

Comments

@markshannon
Copy link
Member

markshannon commented Sep 13, 2022

We want to be able to specialize iteration over generators and awaiting coroutines. Both for PEP 659 and for higher tier optimizers.

For the theory see faster-cpython/ideas#457

To do this we need:

Edited:
Remove the requirement for a GEN_RETURN_VALUE instruction. We might want one to simplify frame popping, but it isn't needed for specializing.

@markshannon markshannon added the performance Performance or resource usage label Sep 13, 2022
markshannon added a commit that referenced this issue Oct 27, 2022
…H-96801)

Change FOR_ITER to have the same stack effect regardless of whether it branches or not.
Performance is unchanged as FOR_ITER (and specialized forms jump over the cleanup code).
gvanrossum pushed a commit to gvanrossum/cpython that referenced this issue Oct 28, 2022
…on. (pythonGH-96801)

Change FOR_ITER to have the same stack effect regardless of whether it branches or not.
Performance is unchanged as FOR_ITER (and specialized forms jump over the cleanup code).
markshannon added a commit that referenced this issue Nov 3, 2022
* Handle converting StopIteration to RuntimeError in bytecode.

* Add custom instruction for converting StopIteration into RuntimeError.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance or resource usage
Projects
None yet
Development

No branches or pull requests

1 participant