-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
GH-123040: Specialize shadowed LOAD_ATTR
.
#123219
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
GH-123040: Specialize shadowed LOAD_ATTR
.
#123219
Conversation
…ttribute. Provided that class attribute is not a data descriptor
…ass attributes with metaclasses or shadowed attributes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stats show a 30% reduction in specialization failures for LOAD_ATTR.
Performance might show a slight speedup, but is more likely just noise.
Why is it useful to improve specialisation stats if it's not also improving performance?
It probably does improve performance, and we would expect it to, but it's too small to measure. We also expect the difference to be magnified on tier 2, once that is more complete. |
LGTM, but I think another reviewer might make sense, @brandtbucher or @Fidget-Spinner maybe. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is some pretty subtle stuff, but it looks correct to me! I wasn't able to make it do anything incorrect with a local build.
This PR specializes
LOAD_ATTR
for shadowed attributes, where the shadowing doesn't change the attribute.Stats show a 30% reduction in specialization failures for
LOAD_ATTR
.Performance might show a slight speedup, but is more likely just noise.
LOAD_ATTR
andSTORE_ATTR
when attributes are shadowed by the object's class. #123040