-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
GH-134584: Remove redundant refcount from _STORE_ATTR_SLOT
#142729
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-134584: Remove redundant refcount from _STORE_ATTR_SLOT
#142729
Conversation
Fidget-Spinner
left a comment
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.
Nice job, you're pretty close already. Just one thing missing.
|
Just to demonstrate the power of this class of optimization. If you were able to remove all decrefs from Before (current main): After: So it's roughly half of the original size of code. The problem right now is that we can't (yet) remove the _STORE_ATTR_SLOT's Py_XDECREF. However, in the very near future once we specialize on more forms of object creation, we can optimize thru that. Then for something like We would be able to reason that the current object is a fresh one, thus there's no decref needed as there's no attribute currently. So we'd be able to get the full optimization. (The above example is for non-slots, but it's the same idea). |
Fidget-Spinner
left a comment
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.
Thanks, LGTM. Let's wait a day before merging.
Uh oh!
There was an error while loading. Please reload this page.