FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-131798: Optimize `_ITER_CHECK_TUPLE` by noamcohen97 · Pull Request #134803 · python/cpython · GitHub

Repository navigation

gh-131798: Optimize _ITER_CHECK_TUPLE - #134803

Merged
Fidget-Spinner merged 2 commits into
python:mainfrom
noamcohen97:optimizer-iter-check-tuple
May 27, 2025
Merged

Fidget-Spinner merged 2 commits into
python:mainfrom
noamcohen97:optimizer-iter-check-tuple

Conversation

noamcohen97 commented May 27, 2025 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nice, thanks! Normally we want to add a test verifying the optimization is working too. However, this is a special case --- just to let you know how the tracer currently works, we trace from backwards jumps. Once we see a for loop, we try "closing" the loop. Thus, we would never see _ITER_CHECK_TUPLE except for a nested for loop. However, since the inner loop will always warm up before the outer loop, it will be hard to extract the real trace we want to inspect.

In short, your testing code might look like this:

for i in range(WARMUP):
    for x in (1,2,3):
        pass

but that will generate 2 JIT executors, not just 1, so it will cause us some issues when trying to identify the jitted code.

This is more of a side ramble about the limitations of our testing infrastructure, nothing you can do to fix it till we fix the testing on our side.

Copy link
Copy Markdown
Contributor Author

Thanks @Fidget-Spinner and @tomasr8 for reviewing

Fidget-Spinner merged commit 79d81f7 into python:main May 27, 2025
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
gostak-dd pushed a commit to gostak-dd/cpython that referenced this pull request Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL