Skip to content

GH-139951: Fix major GC performance regression#140262

Merged
markshannon merged 6 commits intopython:mainfrom
faster-cpython:dont-track-tuples
Oct 21, 2025
Merged

GH-139951: Fix major GC performance regression#140262
markshannon merged 6 commits intopython:mainfrom
faster-cpython:dont-track-tuples

Conversation

@markshannon
Copy link
Member

@markshannon markshannon commented Oct 17, 2025

This PR:

  • Counts number of actually tracked objects, instead of trackable objects. This ensures that untracking tuples has the desired effect of reducing GC overhead
  • Does not track most untrackable tuples during creation. This prevents large numbers of small tuples causing excessive GCs.

For the example in the original report this makes performance on main a bit better than 3.13.

Benchmarking results show this is about neutral on performance otherwise.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants