Skip to content

Conversation

BobTheBuidler
Copy link
Contributor

@BobTheBuidler BobTheBuidler commented Sep 26, 2025

It is not necessary to enter the gen_condition block on the first iteration, we can safely skip it. This won't be particularly impactful but its a low-hanging fruit.

@BobTheBuidler BobTheBuidler changed the title [mypyc] feat: optimize out first if-check in for_loop_helper_with_index [mypyc] feat: optimize away first if-check in for_loop_helper_with_index Sep 26, 2025
Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Makes sense. The C compiler may be able to perform a similar optimization in some cases, but not necessarily in every case where we can do it.

@JukkaL JukkaL merged commit 44bbb18 into python:master Sep 29, 2025
13 checks passed
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.

2 participants