Skip to content

Conversation

BobTheBuidler
Copy link
Contributor

@BobTheBuidler BobTheBuidler commented Oct 2, 2025

During the rtuple boxing stage, if any of the values are a known Literal type we can skip the struct access and just load the static literal. I had already tried doing this before but I don't think it was implemented robustly, this improves the identification of Literal types

@BobTheBuidler BobTheBuidler changed the title [mypyc] feat: implement try_getting_literal in preallocate helper [mypyc] feat: implement try_getting_literal in preallocate helper [1/1] Oct 2, 2025
@BobTheBuidler BobTheBuidler marked this pull request as draft October 2, 2025 03:00
else TupleGet(sequence, i, line)
)
for i, typ in enumerate(get_proper_types(proper_type.items))
for i, typ in enumerate(map(try_getting_literal, proper_type.items))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

On second thought, I'm thinking this maybe this optimization should be a native part of TupleGet?

@BobTheBuidler BobTheBuidler marked this pull request as ready for review October 2, 2025 22:07
BobTheBuidler and others added 4 commits October 8, 2025 21:42
During the rtuple boxing stage, if any of the values are a known Literal type we can skip the struct access and just load the static literal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant