Uh oh!
There was an error while loading. Please reload this page.
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.
bedevere-bot
commented
Dec 11, 2025
🤖 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. |
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 |
MaxiBoether
commented
Dec 12, 2025
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.
) (gh-142617) 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)
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.