-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-142531: Fix free-threaded GC performance regression #142562
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-142531: Fix free-threaded GC performance regression #142562
Conversation
If there are many untracked tuples, the GC will run too often, resulting in poor performance. The fix is to include untracked tuples in the "long lived" object count. The number of frozen objects is also now included since the free-threaded GC must scan those too.
Subtract the objects that are unreachable and add back the ones that are resurrected. This likely doesn't matter in most cases but if the GC is freeing a lot of cyclic garbage then we don't want to over count the long lived objects.
|
🤖 New build scheduled with the buildbot fleet by @nascheme for commit e60bc49 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F142562%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
colesbury
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.
LGTM
|
Thanks @nascheme for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Sorry, @nascheme, I could not cleanly backport this to |
|
Thank you so much for addressing this within 24 hours of reporting this, that is amazing! Do you also plan to backport this to 3.14 or will this ship in 3.15? |
…ythongh-142562) If there are many untracked tuples, the GC will run too often, resulting in poor performance. The fix is to include untracked tuples in the "long lived" object count. The number of frozen objects is also now included since the free-threaded GC must scan those too. (cherry picked from commit e38967e)
|
GH-142617 is a backport of this pull request to the 3.14 branch. |
…h-142562) If there are many untracked tuples, the GC will run too often, resulting in poor performance. The fix is to include untracked tuples in the "long lived" object count. The number of frozen objects is also now included since the free-threaded GC must scan those too.
If there are many untracked tuples, the GC will run too often, resulting in poor performance. The fix is to include untracked tuples in the "long lived" object count. The number of frozen objects is also now included since the free-threaded GC must scan those too.