René's URL Explorer Experiment


Title: gh-118527: Intern code consts in free-threaded build by colesbury · Pull Request #118667 · python/cpython · GitHub

Open Graph Title: gh-118527: Intern code consts in free-threaded build by colesbury · Pull Request #118667 · python/cpython

X Title: gh-118527: Intern code consts in free-threaded build by colesbury · Pull Request #118667 · python/cpython

Description: We already intern and immortalize most string constants. In the free-threaded build, other constants are a frequent source of reference count contention because they are shared by all threads running the same code objects. For example, the following function would not otherwise scale because 1.5 would be a non-immortalized constant shared by all threads that execute run_in_parallel. def run_in_parallel(x, iters): for _ in range(iters): x *= 1.5 return x Issue: gh-118527

Open Graph Description: We already intern and immortalize most string constants. In the free-threaded build, other constants are a frequent source of reference count contention because they are shared by all threads runni...

X Description: We already intern and immortalize most string constants. In the free-threaded build, other constants are a frequent source of reference count contention because they are shared by all threads runni...

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

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:b40b45a6-4ce9-4bb3-1945-fb02c80538fd
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idEA20:1C94F:35A8016:44A8234:6B0233EB
html-safe-noncef14933862bb26d2b3fb8bfb68479d977a76072c7a267117cf80403c2f09d1ea1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTIwOjFDOTRGOjM1QTgwMTY6NDRBODIzNDo2QjAyMzNFQiIsInZpc2l0b3JfaWQiOiIyMTQyMDQyOTQ4NDMzNDkwOTIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaca4e628baf8cad2632a011a58c6fbc75f0d3f2663562745f4ced9379d949c292f
hovercard-subject-tagpull_request:1856766258
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/118667/files
twitter:imagehttps://avatars.githubusercontent.com/u/655866?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/655866?s=400&v=4
og:image:altWe already intern and immortalize most string constants. In the free-threaded build, other constants are a frequent source of reference count contention because they are shared by all threads runni...
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/118667/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F118667%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%2F118667%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/118667/files
Reloadhttps://github.com/python/cpython/pull/118667/files
Reloadhttps://github.com/python/cpython/pull/118667/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
colesburyhttps://github.com/colesbury
python:mainhttps://github.com/python/cpython/tree/main
colesbury:gh-118527-code-constshttps://github.com/colesbury/cpython/tree/gh-118527-code-consts
Conversation 8 https://github.com/python/cpython/pull/118667
Commits 8 https://github.com/python/cpython/pull/118667/commits
Checks 0 https://github.com/python/cpython/pull/118667/checks
Files changed https://github.com/python/cpython/pull/118667/files
Please reload this pagehttps://github.com/python/cpython/pull/118667/files
gh-118527: Intern code consts in free-threaded build https://github.com/python/cpython/pull/118667/files#top
Show all changes 8 commits https://github.com/python/cpython/pull/118667/files
5e8c0f0 gh-118527: Intern code consts in free-threaded build colesbury May 3, 2024 https://github.com/python/cpython/pull/118667/commits/5e8c0f02ce90db20aef2062e09df5fcaef83b8ce
670ebf0 Add lock to LOCKS_INIT colesbury May 6, 2024 https://github.com/python/cpython/pull/118667/commits/670ebf0232e42ea7830353c3107e28bd01703a53
ddd088d Handle slice members colesbury May 6, 2024 https://github.com/python/cpython/pull/118667/commits/ddd088d75dfafb30c4c8cd3fa0d60a78c9c2d52d
19ee314 Add unit test colesbury May 6, 2024 https://github.com/python/cpython/pull/118667/commits/19ee314dc143c816718289bfe7311d661793950a
d234658 Intern all string constants in the free-threaded build colesbury May 6, 2024 https://github.com/python/cpython/pull/118667/commits/d234658ad57cc842b7888b95693d90cf903fdaf7
aee1184 Keep test_frozenmain.h stable colesbury May 6, 2024 https://github.com/python/cpython/pull/118667/commits/aee1184c3a694ece5542f3b22a56cf018470ee7d
e3893b5 Merge branch 'main' into gh-118527-code-consts colesbury May 6, 2024 https://github.com/python/cpython/pull/118667/commits/e3893b5e47f2f0bf8edfe53d41a43ec33a1c2b9b
f5cab78 Fix test and keep test_frozenmain.h stable colesbury May 6, 2024 https://github.com/python/cpython/pull/118667/commits/f5cab7832df1c04fecd4d02875b7e4b56462d791
Clear filters https://github.com/python/cpython/pull/118667/files
Please reload this pagehttps://github.com/python/cpython/pull/118667/files
Please reload this pagehttps://github.com/python/cpython/pull/118667/files
pycore_code.h https://github.com/python/cpython/pull/118667/files#diff-97ea1759f82531a45fa685065ff86bc1077c3ab3d5f65220eea48b7730032bc8
pycore_interp.h https://github.com/python/cpython/pull/118667/files#diff-cb06b7ba43789a1d6ae5bef46baa8a255b72dbcd2b44bfec7f146ea4e94dbfa0
pycore_setobject.h https://github.com/python/cpython/pull/118667/files#diff-43c2dee2f8b4443a2bddf2593931bd50efa2aea643f89c65421d92e6e6df03b1
__init__.py https://github.com/python/cpython/pull/118667/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
test_code.py https://github.com/python/cpython/pull/118667/files#diff-08d8a239ab9b84cf01875e28a6dae873628b56bfe94d30c3336c4a607d8036e5
test_internals.py https://github.com/python/cpython/pull/118667/files#diff-c0fb8353bb97bb7c7cb2c4ff398a6c2442ee7c19a8fff01d21fa71a5bdd36c6c
test_python_api.py https://github.com/python/cpython/pull/118667/files#diff-ac7b0c264c623e779d9ba7cb97a6d9c4ef75f5b890b14acf9ddf593f85a5abd8
test_memoryio.py https://github.com/python/cpython/pull/118667/files#diff-ab2f917c9da1a7cc15a25cebacc44bcbddf809cc364eb02b29b14fce3d7d514f
_testinternalcapi.c https://github.com/python/cpython/pull/118667/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
codeobject.c https://github.com/python/cpython/pull/118667/files#diff-6f869eb8beb7cbe4bc6817584b99ad567f88962fa67f7beca25d009dc401234d
setobject.c https://github.com/python/cpython/pull/118667/files#diff-537c6127e75079330edcb3775b0b9c2e4aeb34530dfe224ef2c96c3acb42111f
bltinmodule.c https://github.com/python/cpython/pull/118667/files#diff-e4fd8b8ee6a147f86c0719ff122aca6dfca36edbd4812c87892698b3b72e40a1
pylifecycle.c https://github.com/python/cpython/pull/118667/files#diff-69223f5bb01f359a23246afbbf75b45c622e719424418d658674fbb6c2b36fad
pystate.c https://github.com/python/cpython/pull/118667/files#diff-7ac11e526f79b42d6ea9d3592cb99da46775640c69fa5510f4a6de87cced7141
Include/internal/pycore_code.hhttps://github.com/python/cpython/pull/118667/files#diff-97ea1759f82531a45fa685065ff86bc1077c3ab3d5f65220eea48b7730032bc8
View file https://github.com/colesbury/cpython/blob/f5cab7832df1c04fecd4d02875b7e4b56462d791/Include/internal/pycore_code.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/118667/{{ revealButtonHref }}
https://github.com/python/cpython/pull/118667/files#diff-97ea1759f82531a45fa685065ff86bc1077c3ab3d5f65220eea48b7730032bc8
https://github.com/python/cpython/pull/118667/files#diff-97ea1759f82531a45fa685065ff86bc1077c3ab3d5f65220eea48b7730032bc8
Please reload this pagehttps://github.com/python/cpython/pull/118667/files
https://github.com/python/cpython/pull/118667/files#diff-97ea1759f82531a45fa685065ff86bc1077c3ab3d5f65220eea48b7730032bc8
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L325
Include/internal/pycore_interp.hhttps://github.com/python/cpython/pull/118667/files#diff-cb06b7ba43789a1d6ae5bef46baa8a255b72dbcd2b44bfec7f146ea4e94dbfa0
View file https://github.com/colesbury/cpython/blob/f5cab7832df1c04fecd4d02875b7e4b56462d791/Include/internal/pycore_interp.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/118667/{{ revealButtonHref }}
https://github.com/python/cpython/pull/118667/files#diff-cb06b7ba43789a1d6ae5bef46baa8a255b72dbcd2b44bfec7f146ea4e94dbfa0
https://github.com/python/cpython/pull/118667/files#diff-cb06b7ba43789a1d6ae5bef46baa8a255b72dbcd2b44bfec7f146ea4e94dbfa0
Include/internal/pycore_setobject.hhttps://github.com/python/cpython/pull/118667/files#diff-43c2dee2f8b4443a2bddf2593931bd50efa2aea643f89c65421d92e6e6df03b1
View file https://github.com/colesbury/cpython/blob/f5cab7832df1c04fecd4d02875b7e4b56462d791/Include/internal/pycore_setobject.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/118667/{{ revealButtonHref }}
https://github.com/python/cpython/pull/118667/files#diff-43c2dee2f8b4443a2bddf2593931bd50efa2aea643f89c65421d92e6e6df03b1
https://github.com/python/cpython/pull/118667/files#diff-43c2dee2f8b4443a2bddf2593931bd50efa2aea643f89c65421d92e6e6df03b1
Lib/test/support/__init__.pyhttps://github.com/python/cpython/pull/118667/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
View file https://github.com/colesbury/cpython/blob/f5cab7832df1c04fecd4d02875b7e4b56462d791/Lib/test/support/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/118667/{{ revealButtonHref }}
https://github.com/python/cpython/pull/118667/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
https://github.com/python/cpython/pull/118667/files#diff-d925268c057737ba320c489ca302fd5125f14840d22e50cfe226bdb5bb88ba8d
Lib/test/test_code.pyhttps://github.com/python/cpython/pull/118667/files#diff-08d8a239ab9b84cf01875e28a6dae873628b56bfe94d30c3336c4a607d8036e5
View file https://github.com/colesbury/cpython/blob/f5cab7832df1c04fecd4d02875b7e4b56462d791/Lib/test/test_code.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/118667/{{ revealButtonHref }}
https://github.com/python/cpython/pull/118667/files#diff-08d8a239ab9b84cf01875e28a6dae873628b56bfe94d30c3336c4a607d8036e5
https://github.com/python/cpython/pull/118667/files#diff-08d8a239ab9b84cf01875e28a6dae873628b56bfe94d30c3336c4a607d8036e5
https://github.com/python/cpython/pull/118667/files#diff-08d8a239ab9b84cf01875e28a6dae873628b56bfe94d30c3336c4a607d8036e5
https://github.com/python/cpython/pull/118667/files#diff-08d8a239ab9b84cf01875e28a6dae873628b56bfe94d30c3336c4a607d8036e5
Lib/test/test_ctypes/test_internals.pyhttps://github.com/python/cpython/pull/118667/files#diff-c0fb8353bb97bb7c7cb2c4ff398a6c2442ee7c19a8fff01d21fa71a5bdd36c6c
View file https://github.com/colesbury/cpython/blob/f5cab7832df1c04fecd4d02875b7e4b56462d791/Lib/test/test_ctypes/test_internals.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/118667/{{ revealButtonHref }}
https://github.com/python/cpython/pull/118667/files#diff-c0fb8353bb97bb7c7cb2c4ff398a6c2442ee7c19a8fff01d21fa71a5bdd36c6c
https://github.com/python/cpython/pull/118667/files#diff-c0fb8353bb97bb7c7cb2c4ff398a6c2442ee7c19a8fff01d21fa71a5bdd36c6c
Lib/test/test_ctypes/test_python_api.pyhttps://github.com/python/cpython/pull/118667/files#diff-ac7b0c264c623e779d9ba7cb97a6d9c4ef75f5b890b14acf9ddf593f85a5abd8
View file https://github.com/colesbury/cpython/blob/f5cab7832df1c04fecd4d02875b7e4b56462d791/Lib/test/test_ctypes/test_python_api.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/118667/{{ revealButtonHref }}
https://github.com/python/cpython/pull/118667/files#diff-ac7b0c264c623e779d9ba7cb97a6d9c4ef75f5b890b14acf9ddf593f85a5abd8
https://github.com/python/cpython/pull/118667/files#diff-ac7b0c264c623e779d9ba7cb97a6d9c4ef75f5b890b14acf9ddf593f85a5abd8
Lib/test/test_memoryio.pyhttps://github.com/python/cpython/pull/118667/files#diff-ab2f917c9da1a7cc15a25cebacc44bcbddf809cc364eb02b29b14fce3d7d514f
View file https://github.com/colesbury/cpython/blob/f5cab7832df1c04fecd4d02875b7e4b56462d791/Lib/test/test_memoryio.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/118667/{{ revealButtonHref }}
https://github.com/python/cpython/pull/118667/files#diff-ab2f917c9da1a7cc15a25cebacc44bcbddf809cc364eb02b29b14fce3d7d514f
https://github.com/python/cpython/pull/118667/files#diff-ab2f917c9da1a7cc15a25cebacc44bcbddf809cc364eb02b29b14fce3d7d514f
Modules/_testinternalcapi.chttps://github.com/python/cpython/pull/118667/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
View file https://github.com/colesbury/cpython/blob/f5cab7832df1c04fecd4d02875b7e4b56462d791/Modules/_testinternalcapi.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/118667/{{ revealButtonHref }}
https://github.com/python/cpython/pull/118667/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/118667/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/118667/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/118667/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
Please reload this pagehttps://github.com/python/cpython/pull/118667/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.