Skip to content

Avoid redundant garbage collector traversals #159437

Open

Description

@mfalco-oai

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.

Activity

  1. added
    performancePerformance or resource usage
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    3.16new features, bugs and security fixes
    on Oct 14, 2026
  2. brandt-oai commented on Oct 14, 2026

    @brandt-oai
  3. picnixz commented on Oct 14, 2026

    @picnixz
    Member
  4. pablogsal commented on Oct 14, 2026

    @pablogsal
    Member

    Parented to #159137 (see previous work there)

  5. added a commit that references this issue on Oct 16, 2026
  6. mfalco-oai commented on Oct 16, 2026

    @mfalco-oai
    Author

    I'll add fresh performance numbers and then move these out of draft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.16new features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetype-featureA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions