This issue tracks a series of GC optimizations that we have made in OpenAI’s CPython fork and would like to bring upstream. They target the garbage collector in GIL-enabled builds and reduce repeated walks over the same objects during collection.
The work includes:
In production at OpenAI, we've observed roughly a one-third reduction in GC time with these combined improvements.
CC @pablogsal
cc @markshannon
Parented to #159137 (see previous work there)
pythongh-159437: Skip traversal for untrackable tuple survivors
I'll add fresh performance numbers and then move these out of draft
pythongh-159437: Support frozen objects in fused GC reference passes
pythongh-159437: Remove redundant tuple untracking guards
Activity
brandt-oai commented on Oct 14, 2026
CC @pablogsal
picnixz commented on Oct 14, 2026
cc @markshannon
pablogsal commented on Oct 14, 2026
Parented to #159137 (see previous work there)
pythongh-159437: Skip traversal for untrackable tuple survivors
mfalco-oai commented on Oct 16, 2026
I'll add fresh performance numbers and then move these out of draft
pythongh-159437: Support frozen objects in fused GC reference passes
pythongh-159437: Support frozen objects in fused GC reference passes
pythongh-159437: Support frozen objects in fused GC reference passes
pythongh-159437: Skip traversal for untrackable tuple survivors
pythongh-159437: Remove redundant tuple untracking guards