René's URL Explorer Experiment


Title: GH-139951: Fix major GC performance regression by markshannon · Pull Request #140262 · python/cpython · GitHub

Open Graph Title: GH-139951: Fix major GC performance regression by markshannon · Pull Request #140262 · python/cpython

X Title: GH-139951: Fix major GC performance regression by markshannon · Pull Request #140262 · python/cpython

Description: 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. Issue: gh-139951

Open Graph Description: 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...

X Description: 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...

Opengraph URL: https://github.com/python/cpython/pull/140262

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:16f98f77-dd62-f1b8-a5dc-ec7dce1acb20
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAF92:35B8D6:AD3B5:F4BBE:696A61D2
html-safe-noncec701cecefafd38fee365e4076ad4f9d8b418d24018f0395679c6d4b988aaddc0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjkyOjM1QjhENjpBRDNCNTpGNEJCRTo2OTZBNjFEMiIsInZpc2l0b3JfaWQiOiI3MDI2NTg1NDExNzk3ODk3NzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac5d563e4daecc60f88647aa540dc5d0767fb8cac3cb27050cbf99b5f5a68f4375
hovercard-subject-tagpull_request:2925082736
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/140262/files
twitter:imagehttps://avatars.githubusercontent.com/u/9448417?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/9448417?s=400&v=4
og:image:altThis 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...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9b7735a184970dd9333b2cbe036c8f3c0a9108c64aaa93827c5a64fc70993392
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release87cbd411c2982752221b5751d583a515b23bf5fa
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/140262/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F140262%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F140262%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/140262/files
Reloadhttps://github.com/python/cpython/pull/140262/files
Reloadhttps://github.com/python/cpython/pull/140262/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/140262/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/140262/files
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
markshannonhttps://github.com/markshannon
python:mainhttps://github.com/python/cpython/tree/main
faster-cpython:dont-track-tupleshttps://github.com/faster-cpython/cpython/tree/dont-track-tuples
Conversation 26 https://github.com/python/cpython/pull/140262
Commits 6 https://github.com/python/cpython/pull/140262/commits
Checks 45 https://github.com/python/cpython/pull/140262/checks
Files changed https://github.com/python/cpython/pull/140262/files
Please reload this pagehttps://github.com/python/cpython/pull/140262/files
GH-139951: Fix major GC performance regression https://github.com/python/cpython/pull/140262/files#top
Show all changes 6 commits https://github.com/python/cpython/pull/140262/files
2e8d020 Fix major GC performance regression markshannon Oct 16, 2025 https://github.com/python/cpython/pull/140262/commits/2e8d02023cd84bc103b0a8130fd3c9d376748ad1
6c78c01 Add news markshannon Oct 17, 2025 https://github.com/python/cpython/pull/140262/commits/6c78c018f8afbcc321cbff2ea000f8e5b7d83e54
c5836be Address review comments markshannon Oct 20, 2025 https://github.com/python/cpython/pull/140262/commits/c5836be5e2ee35626b7849b227a09438672e2a37
bde53f4 Up limit to 100000 markshannon Oct 20, 2025 https://github.com/python/cpython/pull/140262/commits/bde53f4e80d6abcac2925e66031b75c88e1f834a
1c2030a Remove erroneous comment markshannon Oct 20, 2025 https://github.com/python/cpython/pull/140262/commits/1c2030a93ef4928c5d3a4044d7e4aa8af112ad7a
698e5f5 Address review comments markshannon Oct 21, 2025 https://github.com/python/cpython/pull/140262/commits/698e5f5a4aae788896d5196e957c6d8681eca5af
Clear filters https://github.com/python/cpython/pull/140262/files
Please reload this pagehttps://github.com/python/cpython/pull/140262/files
Please reload this pagehttps://github.com/python/cpython/pull/140262/files
pycore_gc.h https://github.com/python/cpython/pull/140262/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
test_gc.py https://github.com/python/cpython/pull/140262/files#diff-9d9e863bd2a456b669ec9600be793699e861340d91d7c417a8a5b5b8cfbd09a7
2025-10-17-18-03-12.gh-issue-139951.IdwM2O.rst https://github.com/python/cpython/pull/140262/files#diff-ddaf9bd78f4bd9f9729f4890236bf316d52be09c13e186988ef6b116e539dcf1
tupleobject.c https://github.com/python/cpython/pull/140262/files#diff-1c580282bd10a8157cc81dd4a4658d4bb47f75ea476cd433bc7435913b33eb77
gc.c https://github.com/python/cpython/pull/140262/files#diff-a848a0ef178aa113a092e72403da0e344f37bd141bb90a7aa65015c77bfe7385
Include/internal/pycore_gc.hhttps://github.com/python/cpython/pull/140262/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
View file https://github.com/faster-cpython/cpython/blob/698e5f5a4aae788896d5196e957c6d8681eca5af/Include/internal/pycore_gc.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/140262/{{ revealButtonHref }}
https://github.com/python/cpython/pull/140262/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
https://github.com/python/cpython/pull/140262/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
https://github.com/python/cpython/pull/140262/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
https://github.com/python/cpython/pull/140262/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
https://github.com/python/cpython/pull/140262/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
Please reload this pagehttps://github.com/python/cpython/pull/140262/files
https://github.com/python/cpython/pull/140262/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
https://github.com/python/cpython/pull/140262/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
https://github.com/python/cpython/pull/140262/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
Lib/test/test_gc.pyhttps://github.com/python/cpython/pull/140262/files#diff-9d9e863bd2a456b669ec9600be793699e861340d91d7c417a8a5b5b8cfbd09a7
View file https://github.com/faster-cpython/cpython/blob/698e5f5a4aae788896d5196e957c6d8681eca5af/Lib/test/test_gc.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/140262/{{ revealButtonHref }}
https://github.com/python/cpython/pull/140262/files#diff-9d9e863bd2a456b669ec9600be793699e861340d91d7c417a8a5b5b8cfbd09a7
https://github.com/python/cpython/pull/140262/files#diff-9d9e863bd2a456b669ec9600be793699e861340d91d7c417a8a5b5b8cfbd09a7
https://github.com/python/cpython/pull/140262/files#diff-9d9e863bd2a456b669ec9600be793699e861340d91d7c417a8a5b5b8cfbd09a7
https://github.com/python/cpython/pull/140262/files#diff-9d9e863bd2a456b669ec9600be793699e861340d91d7c417a8a5b5b8cfbd09a7
https://github.com/python/cpython/pull/140262/files#diff-9d9e863bd2a456b669ec9600be793699e861340d91d7c417a8a5b5b8cfbd09a7
https://github.com/python/cpython/pull/140262/files#diff-9d9e863bd2a456b669ec9600be793699e861340d91d7c417a8a5b5b8cfbd09a7
Misc/NEWS.d/next/Core_and_Builtins/2025-10-17-18-03-12.gh-issue-139951.IdwM2O.rsthttps://github.com/python/cpython/pull/140262/files#diff-ddaf9bd78f4bd9f9729f4890236bf316d52be09c13e186988ef6b116e539dcf1
View file https://github.com/faster-cpython/cpython/blob/698e5f5a4aae788896d5196e957c6d8681eca5af/Misc/NEWS.d/next/Core_and_Builtins/2025-10-17-18-03-12.gh-issue-139951.IdwM2O.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/140262/{{ revealButtonHref }}
Objects/tupleobject.chttps://github.com/python/cpython/pull/140262/files#diff-1c580282bd10a8157cc81dd4a4658d4bb47f75ea476cd433bc7435913b33eb77
View file https://github.com/faster-cpython/cpython/blob/698e5f5a4aae788896d5196e957c6d8681eca5af/Objects/tupleobject.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/140262/{{ revealButtonHref }}
https://github.com/python/cpython/pull/140262/files#diff-1c580282bd10a8157cc81dd4a4658d4bb47f75ea476cd433bc7435913b33eb77
Please reload this pagehttps://github.com/python/cpython/pull/140262/files
https://github.com/python/cpython/pull/140262/files#diff-1c580282bd10a8157cc81dd4a4658d4bb47f75ea476cd433bc7435913b33eb77
https://github.com/python/cpython/pull/140262/files#diff-1c580282bd10a8157cc81dd4a4658d4bb47f75ea476cd433bc7435913b33eb77
https://github.com/python/cpython/pull/140262/files#diff-1c580282bd10a8157cc81dd4a4658d4bb47f75ea476cd433bc7435913b33eb77
https://github.com/python/cpython/pull/140262/files#diff-1c580282bd10a8157cc81dd4a4658d4bb47f75ea476cd433bc7435913b33eb77
https://github.com/python/cpython/pull/140262/files#diff-1c580282bd10a8157cc81dd4a4658d4bb47f75ea476cd433bc7435913b33eb77
Python/gc.chttps://github.com/python/cpython/pull/140262/files#diff-a848a0ef178aa113a092e72403da0e344f37bd141bb90a7aa65015c77bfe7385
View file https://github.com/faster-cpython/cpython/blob/698e5f5a4aae788896d5196e957c6d8681eca5af/Python/gc.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/140262/{{ revealButtonHref }}
https://github.com/python/cpython/pull/140262/files#diff-a848a0ef178aa113a092e72403da0e344f37bd141bb90a7aa65015c77bfe7385
Please reload this pagehttps://github.com/python/cpython/pull/140262/files
https://github.com/python/cpython/pull/140262/files#diff-a848a0ef178aa113a092e72403da0e344f37bd141bb90a7aa65015c77bfe7385
Please reload this pagehttps://github.com/python/cpython/pull/140262/files
https://github.com/python/cpython/pull/140262/files#diff-a848a0ef178aa113a092e72403da0e344f37bd141bb90a7aa65015c77bfe7385
https://github.com/python/cpython/pull/140262/files#diff-a848a0ef178aa113a092e72403da0e344f37bd141bb90a7aa65015c77bfe7385
https://github.com/python/cpython/pull/140262/files#diff-a848a0ef178aa113a092e72403da0e344f37bd141bb90a7aa65015c77bfe7385
https://github.com/python/cpython/pull/140262/files#diff-a848a0ef178aa113a092e72403da0e344f37bd141bb90a7aa65015c77bfe7385
Please reload this pagehttps://github.com/python/cpython/pull/140262/files
Please reload this pagehttps://github.com/python/cpython/pull/140262/files
https://github.com/python/cpython/pull/140262/files#diff-a848a0ef178aa113a092e72403da0e344f37bd141bb90a7aa65015c77bfe7385
https://github.com/python/cpython/pull/140262/files#diff-a848a0ef178aa113a092e72403da0e344f37bd141bb90a7aa65015c77bfe7385
https://github.com/python/cpython/pull/140262/files#diff-a848a0ef178aa113a092e72403da0e344f37bd141bb90a7aa65015c77bfe7385
https://github.com/python/cpython/pull/140262/files#diff-a848a0ef178aa113a092e72403da0e344f37bd141bb90a7aa65015c77bfe7385
Please reload this pagehttps://github.com/python/cpython/pull/140262/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.