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

[wip] [mypyc] feat: unroll certain for loops with known params by BobTheBuidler · Pull Request #19518 · python/mypy · GitHub

Repository navigation

[wip] [mypyc] feat: unroll certain for loops with known params - #19518

Draft
BobTheBuidler wants to merge 17 commits into
python:masterfrom
BobTheBuidler:unroll-literal-for-loops
Draft

BobTheBuidler wants to merge 17 commits into
python:masterfrom
BobTheBuidler:unroll-literal-for-loops

Conversation

BobTheBuidler commented Jul 28, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor

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 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 marked this pull request as ready for review July 28, 2025 01:13
BobTheBuidler marked this pull request as draft July 28, 2025 01:14
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
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.

1 participant


Back | FazBrowse Home | New Git URL