Skip to content

Conversation

@nascheme
Copy link
Member

@nascheme nascheme commented Dec 11, 2025

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.
@nascheme nascheme added performance Performance or resource usage topic-free-threading labels Dec 11, 2025
@nascheme nascheme added 3.14 bugs and security fixes 3.15 new features, bugs and security fixes labels Dec 11, 2025
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.
@nascheme nascheme added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 11, 2025
@bedevere-bot
Copy link

🤖 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.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 11, 2025
@nascheme nascheme marked this pull request as ready for review December 11, 2025 17:23
Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nascheme nascheme merged commit e38967e into python:main Dec 11, 2025
52 checks passed
@nascheme nascheme added the needs backport to 3.14 bugs and security fixes label Dec 11, 2025
@miss-islington-app
Copy link

Thanks @nascheme for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @nascheme, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker e38967ed60778146050cc88dd16b70bfd867fde7 3.14

@MaxiBoether
Copy link

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?

nascheme added a commit to nascheme/cpython that referenced this pull request Dec 12, 2025
…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)
@bedevere-app
Copy link

bedevere-app bot commented Dec 12, 2025

GH-142617 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Dec 12, 2025
fatelei pushed a commit to fatelei/cpython that referenced this pull request Dec 12, 2025
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.14 bugs and security fixes 3.15 new features, bugs and security fixes performance Performance or resource usage topic-free-threading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants