GeezerVison is showing github.com — GH-145667: Merge `GET_ITER` and `GET_YIELD_FROM_ITER` by markshannon · Pull Request #146120 · python/cpython
Conversation
markshannon
commented
Mar 18, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Also modifies SEND to make it a bit more like FOR_ITER as both are now fed by GET_ITER.
Apart from saving an opcode, this will enable broadly similar optimizations to be applied to SEND as are already applied to FOR_ITER. Which will be able to:
- significantly improve the performance of
yield from seq where seq is a common iterable, like list.
- allow the JIT to trace through
SEND as it will be mostly specialized.
For now, this is broadly performance neutral, between +0% and -1%, mostly about 0%.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Just to be sure, please run the buildbots
|
markshannon reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Of the 12 failing buildbots, 7 were pre-existing failures and 5 are "new" refleaks.
I put "new" in quotes as there is no easy way to tell whether they were introduced by this PR, another recent PR, or merely exposed by this PR.
However, since this PR is platform independent, there should be leaks everywhere or nowhere.
Also, if GET_ITER or SEND were leaking, then there would be lots of refleaks on many buildbots (and there aren't).
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot ARM64 MacOS M1 Refleaks NoGIL 3.x (tier-2) has failed when building commit 879c85f.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1368/builds/4857) and take a look at the build logs.
- Check if the failure is related to this commit (879c85f) or if it is a false positive.
- If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.
You can take a look at the buildbot page here:
https://buildbot.python.org/#/builders/1368/builds/4857
Failed tests:
Summary of the results of the build (if available):
==
Click to see traceback logs
remote: Enumerating objects: 80, done.
remote: Counting objects: 1% (1/66)
remote: Counting objects: 3% (2/66)
remote: Counting objects: 4% (3/66)
remote: Counting objects: 6% (4/66)
remote: Counting objects: 7% (5/66)
remote: Counting objects: 9% (6/66)
remote: Counting objects: 10% (7/66)
remote: Counting objects: 12% (8/66)
remote: Counting objects: 13% (9/66)
remote: Counting objects: 15% (10/66)
remote: Counting objects: 16% (11/66)
remote: Counting objects: 18% (12/66)
remote: Counting objects: 19% (13/66)
remote: Counting objects: 21% (14/66)
remote: Counting objects: 22% (15/66)
remote: Counting objects: 24% (16/66)
remote: Counting objects: 25% (17/66)
remote: Counting objects: 27% (18/66)
remote: Counting objects: 28% (19/66)
remote: Counting objects: 30% (20/66)
remote: Counting objects: 31% (21/66)
remote: Counting objects: 33% (22/66)
remote: Counting objects: 34% (23/66)
remote: Counting objects: 36% (24/66)
remote: Counting objects: 37% (25/66)
remote: Counting objects: 39% (26/66)
remote: Counting objects: 40% (27/66)
remote: Counting objects: 42% (28/66)
remote: Counting objects: 43% (29/66)
remote: Counting objects: 45% (30/66)
remote: Counting objects: 46% (31/66)
remote: Counting objects: 48% (32/66)
remote: Counting objects: 50% (33/66)
remote: Counting objects: 51% (34/66)
remote: Counting objects: 53% (35/66)
remote: Counting objects: 54% (36/66)
remote: Counting objects: 56% (37/66)
remote: Counting objects: 57% (38/66)
remote: Counting objects: 59% (39/66)
remote: Counting objects: 60% (40/66)
remote: Counting objects: 62% (41/66)
remote: Counting objects: 63% (42/66)
remote: Counting objects: 65% (43/66)
remote: Counting objects: 66% (44/66)
remote: Counting objects: 68% (45/66)
remote: Counting objects: 69% (46/66)
remote: Counting objects: 71% (47/66)
remote: Counting objects: 72% (48/66)
remote: Counting objects: 74% (49/66)
remote: Counting objects: 75% (50/66)
remote: Counting objects: 77% (51/66)
remote: Counting objects: 78% (52/66)
remote: Counting objects: 80% (53/66)
remote: Counting objects: 81% (54/66)
remote: Counting objects: 83% (55/66)
remote: Counting objects: 84% (56/66)
remote: Counting objects: 86% (57/66)
remote: Counting objects: 87% (58/66)
remote: Counting objects: 89% (59/66)
remote: Counting objects: 90% (60/66)
remote: Counting objects: 92% (61/66)
remote: Counting objects: 93% (62/66)
remote: Counting objects: 95% (63/66)
remote: Counting objects: 96% (64/66)
remote: Counting objects: 98% (65/66)
remote: Counting objects: 100% (66/66)
remote: Counting objects: 100% (66/66), done.
remote: Compressing objects: 3% (1/30)
remote: Compressing objects: 6% (2/30)
remote: Compressing objects: 10% (3/30)
remote: Compressing objects: 13% (4/30)
remote: Compressing objects: 16% (5/30)
remote: Compressing objects: 20% (6/30)
remote: Compressing objects: 23% (7/30)
remote: Compressing objects: 26% (8/30)
remote: Compressing objects: 30% (9/30)
remote: Compressing objects: 33% (10/30)
remote: Compressing objects: 36% (11/30)
remote: Compressing objects: 40% (12/30)
remote: Compressing objects: 43% (13/30)
remote: Compressing objects: 46% (14/30)
remote: Compressing objects: 50% (15/30)
remote: Compressing objects: 53% (16/30)
remote: Compressing objects: 56% (17/30)
remote: Compressing objects: 60% (18/30)
remote: Compressing objects: 63% (19/30)
remote: Compressing objects: 66% (20/30)
remote: Compressing objects: 70% (21/30)
remote: Compressing objects: 73% (22/30)
remote: Compressing objects: 76% (23/30)
remote: Compressing objects: 80% (24/30)
remote: Compressing objects: 83% (25/30)
remote: Compressing objects: 86% (26/30)
remote: Compressing objects: 90% (27/30)
remote: Compressing objects: 93% (28/30)
remote: Compressing objects: 96% (29/30)
remote: Compressing objects: 100% (30/30)
remote: Compressing objects: 100% (30/30), done.
remote: Total 80 (delta 40), reused 36 (delta 36), pack-reused 14 (from 2)
From https://github.com/python/cpython
* branch main -> FETCH_HEAD
Note: switching to '879c85f6e4ca8424ff6b4fddfbc946889572bf13'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 879c85f6e4c GH-145667: Merge `GET_ITER` and `GET_YIELD_FROM_ITER` (GH-146120)
Switched to and reset branch 'main'
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.
make: *** [buildbottest] Error 2
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
if (instructions[i].op.code == GET_ITER) {
|
|
|
fixup_getiter(&instructions[i], flags);
|
|
|
}
|
|
|
i += _PyOpcode_Caches[opcode];
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opcode isn't defined here if not ENABLE_SPECIALIZATION. This causes a build error, see #148825. Possible fix in #148826.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ljfp
pushed a commit
to ljfp/cpython
that referenced
this pull request
Apr 25, 2026
…-146120)
* Merge GET_ITER and GET_YIELD_FROM_ITER. Modify SEND to make it a bit more like FOR_ITER
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|