-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
gh-139951: Do not track immutable tuples in GC #140204
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
base: main
Are you sure you want to change the base?
gh-139951: Do not track immutable tuples in GC #140204
Conversation
This is just an expirement to improve Sergey's PR to solve this issue #139951 |
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Is it correct that |
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.
Ok, the PR looks complete now. It's maybe time to run benchmark to measure the performance overhead of this change!
That's because test C |
The approach here is to check for tuples of immutables at creation time. An alternative could be to do this inside the garbage collector (and untrack the tuple if needed). Was that considered? The issue solved here is about a use case where many tuples are created in a tight loop. But there could potentially also be tuples of immutables in a normal workflow that visited many times by the GC. One datapoint: after starting up my "normal" work and running this script
I get as output:
So for me the amount of tuples would not be reduced a lot, but it would be interesting to apply the same approach to the |
This is already doing in the GC (see |
Uh oh!
There was an error while loading. Please reload this page.