René's URL Explorer Experiment


Title: gh-159437: Support frozen objects in combined GC reference passes by mfalco-oai · Pull Request #159597 · python/cpython · GitHub

Open Graph Title: gh-159437: Support frozen objects in combined GC reference passes by mfalco-oai · Pull Request #159597 · python/cpython

X Title: gh-159437: Support frozen objects in combined GC reference passes by mfalco-oai · Pull Request #159597 · python/cpython

Description: With this optimization the GIL collector can use the combined reference pass during the initial reachability analysis of full collections with frozen objects, on builds with 64-bit pointers. Bit 2 of _gc_prev identifies objects owned by the permanent generation, so the pass leaves their temporary reference state untouched. The marker requires a minimum alignment of 8 bytes for exposed object layouts; opaque headers keep _PyObject_MIN_ALIGNMENT at 4. gc.freeze() and gc.unfreeze() walk their lists to set and clear the marker. Frozen weakrefs retain it while queued for callbacks, and surviving weakrefs have it cleared before moving to the old generation. The guard for subinterpreters and runtime reinitialization still applies. Performance Before is #159595 (413ad5ec); after is this PR at eedc334c. Both builds use -falign-functions=64. btree_gc_only_frozen times full collection of a 200,000-node B-tree created after freezing the startup heap. CPU Before After Change (95% interval) Result AMD 74.860 ms 68.698 ms −8.23% [−11.54%, −4.27%] Inconclusive (A/A failed) ARM 73.122 ms 65.619 ms −10.26% [−11.37%, −9.20%] Improvement Benchmarks: python/pyperformance#496 Issue: gh-159437

Open Graph Description: With this optimization the GIL collector can use the combined reference pass during the initial reachability analysis of full collections with frozen objects, on builds with 64-bit pointers. Bit 2 ...

X Description: With this optimization the GIL collector can use the combined reference pass during the initial reachability analysis of full collections with frozen objects, on builds with 64-bit pointers. Bit 2 ...

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

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:0028ea1c-c26a-2c01-e7dd-3aac9e91cc1c
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB2E8:14700E:3823218:474B84B:6B01EF74
html-safe-nonce1ba82caa72e6f031dbc620834b05aa7cbf057e077b0af2f2dce5a6055010081c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMkU4OjE0NzAwRTozODIzMjE4OjQ3NEI4NEI6NkIwMUVGNzQiLCJ2aXNpdG9yX2lkIjoiODQ4NjAwMDM1Mjc1OTYwMTgxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac78573e1110c5debacf37511e7bf98d0aa89bdfc708c0b277213b28f681976435
hovercard-subject-tagpull_request:4895339977
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/159597/files
twitter:imagehttps://avatars.githubusercontent.com/u/272898724?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/272898724?s=400&v=4
og:image:altWith this optimization the GIL collector can use the combined reference pass during the initial reachability analysis of full collections with frozen objects, on builds with 64-bit pointers. Bit 2 ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/159597/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F159597%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F159597%2Ffiles
Sign uphttps://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/159597/files
Reloadhttps://github.com/python/cpython/pull/159597/files
Reloadhttps://github.com/python/cpython/pull/159597/files
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
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
mfalco-oaihttps://github.com/mfalco-oai
python:mainhttps://github.com/python/cpython/tree/main
mfalco-oai:mfalco-oai/gh-159437-gc-frozen-fusionhttps://github.com/mfalco-oai/cpython/tree/mfalco-oai/gh-159437-gc-frozen-fusion
Conversation 3 https://github.com/python/cpython/pull/159597
Commits 9 https://github.com/python/cpython/pull/159597/commits
Checks 53 https://github.com/python/cpython/pull/159597/checks
Files changed https://github.com/python/cpython/pull/159597/files
Please reload this pagehttps://github.com/python/cpython/pull/159597/files
gh-159437: Support frozen objects in combined GC reference passes https://github.com/python/cpython/pull/159597/files#top
Show all changes 9 commits https://github.com/python/cpython/pull/159597/files
f46b7e5 gh-159437: Skip unnecessary GC finalizer scans mfalco-oai Oct 16, 2026 https://github.com/python/cpython/pull/159597/commits/f46b7e523ad2c45d236e948a6cada99ed0cd7d5f
ff1acf0 gh-159437: Align release build functions to 64-byte boundaries mfalco-oai Oct 19, 2026 https://github.com/python/cpython/pull/159597/commits/ff1acf0a8a0be9e1788977301b68b45f48a93ced
70bc796 gh-159437: Count garbage while clearing weakrefs mfalco-oai Oct 16, 2026 https://github.com/python/cpython/pull/159597/commits/70bc7962d8afb3e0da7345c3bb417dc342bf19e7
0daa202 gh-159437: Skip unnecessary late weakref cleanup mfalco-oai Oct 16, 2026 https://github.com/python/cpython/pull/159597/commits/0daa2029670c7c24d0b2b48944e73d6f3f3e8376
9fe33d4 gh-159437: Combine GC reference passes for full collections mfalco-oai Oct 16, 2026 https://github.com/python/cpython/pull/159597/commits/9fe33d485c421535ce312289172a7706c7823995
c3d1321 gh-159437: Skip unnecessary legacy finalizer scans mfalco-oai Oct 16, 2026 https://github.com/python/cpython/pull/159597/commits/c3d13211157112e775b2b9abe93c7e2a031af291
bb3b661 gh-159437: Combine GC resurrection bookkeeping mfalco-oai Oct 16, 2026 https://github.com/python/cpython/pull/159597/commits/bb3b661fd48ecce120fb484cf4bd70c4eaa8067c
413ad5e gh-159437: Avoid resetting discarded resurrection list mfalco-oai Oct 18, 2026 https://github.com/python/cpython/pull/159597/commits/413ad5ec89fdba14f2dd497871fe2d0ecc6a56d2
eedc334 gh-159437: Support frozen objects in fused GC reference passes mfalco-oai Oct 16, 2026 https://github.com/python/cpython/pull/159597/commits/eedc334c083fd0b104c81ff92de4e8f322bea91f
Clear filters https://github.com/python/cpython/pull/159597/files
Please reload this pagehttps://github.com/python/cpython/pull/159597/files
Please reload this pagehttps://github.com/python/cpython/pull/159597/files
pycore_gc.h https://github.com/python/cpython/pull/159597/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
pycore_interp_structs.h https://github.com/python/cpython/pull/159597/files#diff-6075b6142803c1eccc213aa150704fd639443c65311d5999f69a5ea77cb76756
pycore_pystate.h https://github.com/python/cpython/pull/159597/files#diff-76818a128869986e3de4f16dae0257c430008546f04764cd7ad8254abfa5ce83
object.h https://github.com/python/cpython/pull/159597/files#diff-87272721a5cf1cd9915d6f503f6a7bbefa2f26c935c7ce83ca78706afd0ad05a
garbage_collector.md https://github.com/python/cpython/pull/159597/files#diff-a06f6514b58f30ea7c7cf16f2ca1e707c73c95b4ad08d6bfcf0fe2ed6d3f52bb
test_gc.py https://github.com/python/cpython/pull/159597/files#diff-9d9e863bd2a456b669ec9600be793699e861340d91d7c417a8a5b5b8cfbd09a7
test_backtrace.py https://github.com/python/cpython/pull/159597/files#diff-fe88c91dc8e2faf88fd4e3b86a3e86f641f52e5d050b1340d9942992c0cf4984
Makefile.pre.in https://github.com/python/cpython/pull/159597/files#diff-1f0a8db227d22005511b0d90f5339b97db345917b863954b3b3ccb9ec308767c
2026-10-18-21-30-00.gh-issue-159437.align64.rst https://github.com/python/cpython/pull/159597/files#diff-741bda92e26629d7272c447dbf0505fe41dc248e99802cf246d430861c3f45fb
2026-10-14-21-44-05.gh-issue-159437.count1.rst https://github.com/python/cpython/pull/159597/files#diff-db3cc91c43b452105f122c492e505c983d96d9b94f50b2b116dba919335eecea
2026-10-15-23-43-15.gh-issue-159437.LHuMLA.rst https://github.com/python/cpython/pull/159597/files#diff-6e711a71c0a0441108dcafb0e031ac303b0a1245bc0ce00fb37c226e67d71947
2026-10-16-00-00-00.gh-issue-159437.weakrf.rst https://github.com/python/cpython/pull/159597/files#diff-6d01560d2ef9cd91b112107f2f1456c0bec4ef2e0eedea4ccd10d8bb49b107e0
2026-10-16-01-07-10.gh-issue-159437.reffus.rst https://github.com/python/cpython/pull/159597/files#diff-80e1eca7963600a09ef7e3c7781b0a3f2baa485cdd9d6ff026bcb5c7063f2d69
2026-10-16-01-50-35.gh-issue-159437.resbook.rst https://github.com/python/cpython/pull/159597/files#diff-27d5bc37dcb4aa63aa04a18cb8957aa1a858812e1090fe4f10ee62a94810624e
2026-10-16-05-37-12.gh-issue-159437.legacy.rst https://github.com/python/cpython/pull/159597/files#diff-f587cf1c8eead6d982319853d213b6fee3758cb41ce953e2c21a586c861bb303
2026-10-16-06-05-52.gh-issue-159437.perm.rst https://github.com/python/cpython/pull/159597/files#diff-2fe232b60dbc53db33a1e424e8d5ede26f279928a34f02cadb465d575cc945db
_testembed.c https://github.com/python/cpython/pull/159597/files#diff-68b4b67b7265522a6f47393ef786b2034f5d6c53f1a9574780d72662c2361fad
gc.c https://github.com/python/cpython/pull/159597/files#diff-a848a0ef178aa113a092e72403da0e344f37bd141bb90a7aa65015c77bfe7385
pystate.c https://github.com/python/cpython/pull/159597/files#diff-7ac11e526f79b42d6ea9d3592cb99da46775640c69fa5510f4a6de87cced7141
ignored.tsv https://github.com/python/cpython/pull/159597/files#diff-fa2373a9a002e491408e623369773045f4b7de90114b9f5ba6933bfbf2d8c45c
configure https://github.com/python/cpython/pull/159597/files#diff-90d08e583c4c9c6f391b2ae90f819f600a6326928ea9512c9e0c6d98e9f29ac2
configure.ac https://github.com/python/cpython/pull/159597/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810
Include/internal/pycore_gc.hhttps://github.com/python/cpython/pull/159597/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
View file https://github.com/python/cpython/blob/eedc334c083fd0b104c81ff92de4e8f322bea91f/Include/internal/pycore_gc.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/159597/{{ revealButtonHref }}
https://github.com/python/cpython/pull/159597/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
https://github.com/python/cpython/pull/159597/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
https://github.com/python/cpython/pull/159597/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
https://github.com/python/cpython/pull/159597/files#diff-0e64649e0124da22bbdd808a1902470f99752765073e6f1eb8bbd734ef1f4255
Include/internal/pycore_interp_structs.hhttps://github.com/python/cpython/pull/159597/files#diff-6075b6142803c1eccc213aa150704fd639443c65311d5999f69a5ea77cb76756
View file https://github.com/python/cpython/blob/eedc334c083fd0b104c81ff92de4e8f322bea91f/Include/internal/pycore_interp_structs.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/159597/{{ revealButtonHref }}
https://github.com/python/cpython/pull/159597/files#diff-6075b6142803c1eccc213aa150704fd639443c65311d5999f69a5ea77cb76756
https://github.com/python/cpython/pull/159597/files#diff-6075b6142803c1eccc213aa150704fd639443c65311d5999f69a5ea77cb76756
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L319
Include/internal/pycore_pystate.hhttps://github.com/python/cpython/pull/159597/files#diff-76818a128869986e3de4f16dae0257c430008546f04764cd7ad8254abfa5ce83
View file https://github.com/python/cpython/blob/eedc334c083fd0b104c81ff92de4e8f322bea91f/Include/internal/pycore_pystate.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/159597/{{ revealButtonHref }}
https://github.com/python/cpython/pull/159597/files#diff-76818a128869986e3de4f16dae0257c430008546f04764cd7ad8254abfa5ce83
https://github.com/python/cpython/pull/159597/files#diff-76818a128869986e3de4f16dae0257c430008546f04764cd7ad8254abfa5ce83
Include/object.hhttps://github.com/python/cpython/pull/159597/files#diff-87272721a5cf1cd9915d6f503f6a7bbefa2f26c935c7ce83ca78706afd0ad05a
View file https://github.com/python/cpython/blob/eedc334c083fd0b104c81ff92de4e8f322bea91f/Include/object.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/159597/{{ revealButtonHref }}
https://github.com/python/cpython/pull/159597/files#diff-87272721a5cf1cd9915d6f503f6a7bbefa2f26c935c7ce83ca78706afd0ad05a
https://github.com/python/cpython/pull/159597/files#diff-87272721a5cf1cd9915d6f503f6a7bbefa2f26c935c7ce83ca78706afd0ad05a
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L480
InternalDocs/garbage_collector.mdhttps://github.com/python/cpython/pull/159597/files#diff-a06f6514b58f30ea7c7cf16f2ca1e707c73c95b4ad08d6bfcf0fe2ed6d3f52bb
View file https://github.com/python/cpython/blob/eedc334c083fd0b104c81ff92de4e8f322bea91f/InternalDocs/garbage_collector.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/159597/{{ revealButtonHref }}
https://github.com/python/cpython/pull/159597/files#diff-a06f6514b58f30ea7c7cf16f2ca1e707c73c95b4ad08d6bfcf0fe2ed6d3f52bb
https://github.com/python/cpython/pull/159597/files#diff-a06f6514b58f30ea7c7cf16f2ca1e707c73c95b4ad08d6bfcf0fe2ed6d3f52bb
Please reload this pagehttps://github.com/python/cpython/pull/159597/files
Please reload this pagehttps://github.com/python/cpython/pull/159597/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.