René's URL Explorer Experiment


Title: Extend and improve `LOAD_COMMON_CONSTANT` · Issue #148871 · python/cpython · GitHub

Open Graph Title: Extend and improve `LOAD_COMMON_CONSTANT` · Issue #148871 · python/cpython

X Title: Extend and improve `LOAD_COMMON_CONSTANT` · Issue #148871 · python/cpython

Description: Currently LOAD_COMMON_CONSTANT only loads 7 not-so-common constants and does so fairly inefficiently. It could be improved in two ways: Add some more constants, especially None, but also "", True, False and -1 Make the constants that it ...

Open Graph Description: Currently LOAD_COMMON_CONSTANT only loads 7 not-so-common constants and does so fairly inefficiently. It could be improved in two ways: Add some more constants, especially None, but also "", True, ...

X Description: Currently LOAD_COMMON_CONSTANT only loads 7 not-so-common constants and does so fairly inefficiently. It could be improved in two ways: Add some more constants, especially None, but also "&quo...

Opengraph URL: https://github.com/python/cpython/issues/148871

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Extend and improve `LOAD_COMMON_CONSTANT`","articleBody":"Currently `LOAD_COMMON_CONSTANT` only loads 7 not-so-common constants and does so fairly inefficiently.\n\nIt could be improved in two ways:\n* Add some more constants, especially `None`, but also `\"\"`, `True`, `False` and `-1` \n* ~Make the constants that it does load both statically allocated and immortal to avoid the pointer chasing and incref operation. Only `any` and `all` would need changing.~\n\nAfter some consideration, I think it best to leave the common constants table per interpreter, and not statically allocate them. \n* The changes to `any` and `all` may be breaking. \n* We also need to handle `AssertionError` and `NotImplementedError` will be tricky to make static\n\nThey should all be immortal though, and stored as `_PyStackRef`s not `PyObject *`s.\n\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-148971\n* gh-149625\n* gh-149688\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/markshannon","@type":"Person","name":"markshannon"},"datePublished":"2026-04-22T09:30:20Z","url":"https://github.com/python/cpython/issues/148871"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:23581cc6-946f-3762-b58e-12a48c8c4948
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id94DE:20AA01:3DD7D71:4E7FAFD:6B01FA4C
html-safe-nonced0cb5937c94fba6ad97fef9e760f8716ed26ed0b2b2b07190be00be0a7044eb6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NERFOjIwQUEwMTozREQ3RDcxOjRFN0ZBRkQ6NkIwMUZBNEMiLCJ2aXNpdG9yX2lkIjoiNTIxMDg5NzEzMjY4ODYzNjQ5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac19a6210524f9cffca12edeeec64f249c95f34e903a676f9ad9674c45724003af
hovercard-subject-tagissue:4308042187
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/148871/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5a488a34321820bdb649acb9d1353f02a5f22be2c3261dd53dae7c1498aba6e7/python/cpython/issues/148871
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5a488a34321820bdb649acb9d1353f02a5f22be2c3261dd53dae7c1498aba6e7/python/cpython/issues/148871
og:image:altCurrently LOAD_COMMON_CONSTANT only loads 7 not-so-common constants and does so fairly inefficiently. It could be improved in two ways: Add some more constants, especially None, but also "", True, ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemarkshannon
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
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
disable-turbofalse
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
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/148871#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F148871
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%2Fissues%2F148871
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/148871
Reloadhttps://github.com/python/cpython/issues/148871
Reloadhttps://github.com/python/cpython/issues/148871
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
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/148871
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/148871
Extend and improve LOAD_COMMON_CONSTANThttps://github.com/python/cpython/issues/148871#top
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
performancePerformance or resource usagehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22performance%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/markshannon
markshannonhttps://github.com/markshannon
on Apr 22, 2026https://github.com/python/cpython/issues/148871#issue-4308042187
gh-148871: extend and improve LOAD_COMMON_CONSTANT #148971https://github.com/python/cpython/pull/148971
gh-148871: make LOAD_COMMON_CONSTANT use immortal stackref borrows #149625https://github.com/python/cpython/pull/149625
gh-148871: Add CONSTANT_EMPTY_TUPLE to LOAD_COMMON_CONSTANT #149688https://github.com/python/cpython/pull/149688
markshannonhttps://github.com/markshannon
performancePerformance or resource usagehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22performance%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
on Apr 22, 2026https://github.com/python/cpython/issues/148871#event-24749674783
picnixzhttps://github.com/picnixz
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
on Apr 22, 2026https://github.com/python/cpython/issues/148871#event-24752334987
NekoAsakurahttps://github.com/NekoAsakura
on Apr 26, 2026https://github.com/python/cpython/issues/148871#event-24885636051
Merge branch 'main' into pythongh-148871/load-common-constanthttps://github.com/NekoAsakura/cpython/commit/22595cd687230d039e5fdf95d19cd56cb1dcfb0f
pythongh-148871https://github.com/python/cpython/issues/148871
22595cdhttps://github.com/NekoAsakura/cpython/commit/22595cd687230d039e5fdf95d19cd56cb1dcfb0f
Merge branch 'main' into pythongh-148871/load-common-constanthttps://github.com/NekoAsakura/cpython/commit/ebd1c28c856e5161b62bfb02ce329cebc5ee1a9d
pythongh-148871https://github.com/python/cpython/issues/148871
ebd1c28https://github.com/NekoAsakura/cpython/commit/ebd1c28c856e5161b62bfb02ce329cebc5ee1a9d
Merge branch 'main' into pythongh-148871/load-common-constanthttps://github.com/NekoAsakura/cpython/commit/558a5ac6e3b19aa32e86f8171e6d594f14c77adc
pythongh-148871https://github.com/python/cpython/issues/148871
558a5achttps://github.com/NekoAsakura/cpython/commit/558a5ac6e3b19aa32e86f8171e6d594f14c77adc
Merge branch 'main' into pythongh-148871/load-common-constanthttps://github.com/NekoAsakura/cpython/commit/b017ae992670ef1232f563eeb72859cf030ade6c
pythongh-148871https://github.com/python/cpython/issues/148871
b017ae9https://github.com/NekoAsakura/cpython/commit/b017ae992670ef1232f563eeb72859cf030ade6c
Merge branch 'main' into pythongh-148871/load-common-constanthttps://github.com/NekoAsakura/cpython/commit/cbd17a2a99f6ce535b1c797d3dbebd033dee7c9c
pythongh-148871https://github.com/python/cpython/issues/148871
cbd17a2https://github.com/NekoAsakura/cpython/commit/cbd17a2a99f6ce535b1c797d3dbebd033dee7c9c
markshannonhttps://github.com/markshannon
on May 2, 2026https://github.com/python/cpython/issues/148871#event-25097484040
gh-148871: extend and improve `LOAD_COMMON_CONSTANT` (GH-148971)https://github.com/python/cpython/commit/7c9ad27dd1fc9e05149b471b055f18ad64cd05f3
gh-148871https://github.com/python/cpython/issues/148871
GH-148971https://github.com/python/cpython/pull/148971
7c9ad27https://github.com/python/cpython/commit/7c9ad27dd1fc9e05149b471b055f18ad64cd05f3
https://github.com/markshannon
markshannonhttps://github.com/markshannon
on May 2, 2026https://github.com/python/cpython/issues/148871#issuecomment-4364525019
#148971https://github.com/python/cpython/pull/148971
eendebakpthttps://github.com/eendebakpt
on May 11, 2026https://github.com/python/cpython/issues/148871#event-25391933119
Add NEWS entry for pythongh-148871https://github.com/eendebakpt/cpython/commit/56d633a37e97b937fbd596eaa673788bbf684d6b
pythongh-148871https://github.com/python/cpython/issues/148871
56d633ahttps://github.com/eendebakpt/cpython/commit/56d633a37e97b937fbd596eaa673788bbf684d6b
NekoAsakurahttps://github.com/NekoAsakura
on May 21, 2026https://github.com/python/cpython/issues/148871#event-25782351583
Merge branch 'main' into pythongh-148871-immortal-stackrefhttps://github.com/NekoAsakura/cpython/commit/d81f9b62e87c1f5a44a1057c754a51c4e70e54c8
pythongh-148871https://github.com/python/cpython/issues/148871
d81f9b6https://github.com/NekoAsakura/cpython/commit/d81f9b62e87c1f5a44a1057c754a51c4e70e54c8
markshannonhttps://github.com/markshannon
on May 21, 2026https://github.com/python/cpython/issues/148871#event-25810267241
gh-148871: Add CONSTANT_EMPTY_TUPLE to LOAD_COMMON_CONSTANT (GH-149688)https://github.com/python/cpython/commit/f2fa291db832142484ba536e73df5ac16b1f66fa
gh-148871https://github.com/python/cpython/issues/148871
GH-149688https://github.com/python/cpython/pull/149688
f2fa291https://github.com/python/cpython/commit/f2fa291db832142484ba536e73df5ac16b1f66fa
NekoAsakurahttps://github.com/NekoAsakura
on May 21, 2026https://github.com/python/cpython/issues/148871#event-25813157207
Merge branch 'main' into pythongh-148871-immortal-stackrefhttps://github.com/NekoAsakura/cpython/commit/0cf0de254dac04898e452bf5bf94b8e26163f8a2
pythongh-148871https://github.com/python/cpython/issues/148871
0cf0de2https://github.com/NekoAsakura/cpython/commit/0cf0de254dac04898e452bf5bf94b8e26163f8a2
Merge branch 'main' into pythongh-148871-immortal-stackrefhttps://github.com/NekoAsakura/cpython/commit/9bbbb46bb8efc0a5fc5cef095621143a97098e4e
pythongh-148871https://github.com/python/cpython/issues/148871
9bbbb46https://github.com/NekoAsakura/cpython/commit/9bbbb46bb8efc0a5fc5cef095621143a97098e4e
markshannonhttps://github.com/markshannon
on May 28, 2026https://github.com/python/cpython/issues/148871#event-26059770912
gh-148871: make `LOAD_COMMON_CONSTANT` use immortal stackref borrows (G…https://github.com/python/cpython/commit/39bd44fc7091dde09abfdc27af2559c1fb52c17d
gh-148871https://github.com/python/cpython/issues/148871
G…https://github.com/python/cpython/pull/149625
39bd44fhttps://github.com/python/cpython/commit/39bd44fc7091dde09abfdc27af2559c1fb52c17d
hugovkhttps://github.com/hugovk
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 13, 2026https://github.com/python/cpython/issues/148871#event-36024447015
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/148871
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/148871
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
performancePerformance or resource usagehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22performance%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
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.