GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-131798: Optimize `_ITER_CHECK_TUPLE` by noamcohen97 · Pull Request #134803 · python/cpython

Conversation

@noamcohen97

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

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Better uop coverage in the JIT optimizer #131798

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@noamcohen97
add optimizer op
c6bdd52
@noamcohen97
noamcohen97 requested a review from Fidget-Spinner as a code owner May 27, 2025 17:17
@bedevere-app bedevere-app Bot mentioned this pull request May 27, 2025
Better uop coverage in the JIT optimizer #131798
Open
@bedevere-app bedevere-app Bot added the awaiting review label May 27, 2025
@noamcohen97
add news entry
1499012
Fidget-Spinner
Fidget-Spinner approved these changes May 27, 2025
View reviewed changes

@Fidget-Spinner Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

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.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels May 27, 2025
tomasr8
tomasr8 reviewed May 27, 2025
View reviewed changes
Comment thread Python/optimizer_bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@noamcohen97

noamcohen97 commented May 27, 2025

Copy link
Copy Markdown
Contributor Author

Thanks @Fidget-Spinner and @tomasr8 for reviewing

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner
Fidget-Spinner merged commit 79d81f7 into python:main May 27, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label May 27, 2025
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@noamcohen97 @Pranjal095
pythongh-131798: Optimize _ITER_CHECK_TUPLE (pythonGH-134803)
31c4b29
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
@noamcohen97 @taegyunkim
pythongh-131798: Optimize _ITER_CHECK_TUPLE (pythonGH-134803)
432593c
@Sacul0457 Sacul0457 mentioned this pull request Feb 8, 2026
gh-131798: Optimize _ITER_CHECK_RANGE and _ITER_CHECK_LIST in the JIT #144583
Merged
gostak-dd pushed a commit to gostak-dd/cpython that referenced this pull request Jun 2, 2026
@noamcohen97 @gostak-dd
pythongh-131798: Optimize _ITER_CHECK_TUPLE (pythonGH-134803)
d495aba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tomasr8 tomasr8 tomasr8 left review comments
@Fidget-Spinner Fidget-Spinner Fidget-Spinner approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

3 participants

@noamcohen97 @tomasr8 @Fidget-Spinner
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.