Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tier 2 optimizer: constant propagate through attribute loads #120323

Open
Fidget-Spinner opened this issue Jun 10, 2024 · 2 comments
Open

Tier 2 optimizer: constant propagate through attribute loads #120323

Fidget-Spinner opened this issue Jun 10, 2024 · 2 comments
Assignees
Labels
performance Performance or resource usage type-feature A feature request or enhancement

Comments

@Fidget-Spinner
Copy link
Member

Fidget-Spinner commented Jun 10, 2024

Feature or enhancement

Proposal:

Now that we have type versions installed in #119258 . We can use the information to constant propagate through attribute loads.

This means something like

dict.fromkeys()

becomes the same as

dict_fromkeys()

Note: this is just a constant load, not an attribute lookup!

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

@Fidget-Spinner Fidget-Spinner added the type-feature A feature request or enhancement label Jun 10, 2024
@Fidget-Spinner Fidget-Spinner self-assigned this Jun 10, 2024
@Fidget-Spinner
Copy link
Member Author

CC @saulshanabrook this is building off your work!

@Fidget-Spinner
Copy link
Member Author

Fidget-Spinner commented Jun 10, 2024

Nevermind, I forgot we yet to have a specialization for builtin class loads, so we can't do this until we add the tier 1 specialization.

For now, I can add this for tier 2 just for Python classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance or resource usage type-feature A feature request or enhancement
1 participant