Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

BobTheBuidler
Copy link
Contributor

@BobTheBuidler BobTheBuidler commented Jul 28, 2025

This PR, when finished, will unroll any for loops that iterate across a set of values which are known at compile time

This allows us to entirely bypass any iteration overhead and keep more things in C-space

It also does the same when iterating across the values of any mypyc-defined tuple types, whether the values are known at compile time or not

The generated C code will be longer but more readable with less branching and no iterator overhead, will offer the C compiler many more opportunities for optimization

It's probably best for everyone if these 2 PRs are merged before anyone spends time looking at this one:

@BobTheBuidler BobTheBuidler changed the title [mypyc] feat: unroll literal certain for loops with known params [mypyc] feat: unroll certain for loops with known params Jul 28, 2025
@BobTheBuidler BobTheBuidler marked this pull request as ready for review July 28, 2025 01:13
@BobTheBuidler BobTheBuidler marked this pull request as draft July 28, 2025 01:14
@BobTheBuidler BobTheBuidler changed the title [mypyc] feat: unroll certain for loops with known params [wip] [mypyc] feat: unroll certain for loops with known params Jul 30, 2025
@BobTheBuidler BobTheBuidler force-pushed the unroll-literal-for-loops branch from e68c440 to 7c238c8 Compare September 13, 2025 02:15
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.

1 participant