René's URL Explorer Experiment


Title: Document how to add a bytecode specialization · Issue #1286 · python/devguide · GitHub

Open Graph Title: Document how to add a bytecode specialization · Issue #1286 · python/devguide

X Title: Document how to add a bytecode specialization · Issue #1286 · python/devguide

Description: How to add a new bytecode specialization is knowledge only a few of us remember right now. We should document this somewhere (devguide or CPython, I don't mind). Hopefully a new contributor can pick this up! There reference is this PR: h...

Open Graph Description: How to add a new bytecode specialization is knowledge only a few of us remember right now. We should document this somewhere (devguide or CPython, I don't mind). Hopefully a new contributor can pic...

X Description: How to add a new bytecode specialization is knowledge only a few of us remember right now. We should document this somewhere (devguide or CPython, I don't mind). Hopefully a new contributor can...

Opengraph URL: https://github.com/python/devguide/issues/1286

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Document how to add a bytecode specialization","articleBody":"How to add a new bytecode specialization is knowledge only a few of us remember right now. We should document this somewhere (devguide or CPython, I don't mind). Hopefully a new contributor can pick this up!\r\n\r\nThere reference is this PR: https://github.com/python/cpython/pull/116385/files\r\n\r\nAssuming you found an instruction that serves as a good specialization candidate. Let's use the example of `CONTAINS_OP`:\r\n1. Set the original `CONTAINS_OP` to a uop by changing it from `CONTAINS_OP` to `_CONTAINS_OP` in `Python/bytecodes.c`. The instruction definition should also change from `inst` to `op`.\r\n2. Add the uop that calls a specializing function. In this case `_SPECIALIZE_CONTAINS_OP`.\r\n3. The original `CONTAINS_OP` is now a new macro consisting of `_SPECIALIZE_CONTAINS_OP + _CONTAINS_OP`.\r\n4. Define the cache structure in `Include/internal/pycore_code.h`. At the very least, a 16-bit counter is needed.\r\n5. Write the specializing function itself in `Python/specialize.c`. Refer to any other function in that file for the format.\r\n6. Remember to update operation stats by calling `add_stat_dict` in `Python/specialize.c`.\r\n7. Add the cache layout in `Lib/opcode.py` so that Python's `dis` module will know how to represent it properly.\r\n8. Bump magic number in `Include/internal/pycore_magic_number.h`.\r\n9. Run `make regen-all` on *nix or `build.bat --regen` on PC.","author":{"url":"https://github.com/Fidget-Spinner","@type":"Person","name":"Fidget-Spinner"},"datePublished":"2024-03-06T17:24:44Z","url":"https://github.com/python/devguide/issues/1286"}

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:7f982854-fb2c-b04d-355a-0961ad6ad6cd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8E64:23DB5F:2CD16D:3874C3:6B01F76C
html-safe-nonce23dc63fe1e6c93fdb58162129d586817ec05625ebd51c781cd9d7131f182fb84
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTY0OjIzREI1RjoyQ0QxNkQ6Mzg3NEMzOjZCMDFGNzZDIiwidmlzaXRvcl9pZCI6Ijc3NjUyMjkyMzcyMDM3NjEwMDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb13a8fed38b6725e211307ff53a4a3cb8683c6be3dd935ce9fede07470ed5d47
hovercard-subject-tagissue:2172056425
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/devguide/1286/issue_layout
twitter:imagehttps://opengraph.githubassets.com/fb305d6adafe13332ae0c8c123b01810ec076c5104318477c08cf2927aa73e23/python/devguide/issues/1286
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/fb305d6adafe13332ae0c8c123b01810ec076c5104318477c08cf2927aa73e23/python/devguide/issues/1286
og:image:altHow to add a new bytecode specialization is knowledge only a few of us remember right now. We should document this somewhere (devguide or CPython, I don't mind). Hopefully a new contributor can pic...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameFidget-Spinner
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/devguide git https://github.com/python/devguide.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id63972479
octolytics-dimension-repository_nwopython/devguide
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id63972479
octolytics-dimension-repository_network_root_nwopython/devguide
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/devguide/issues/1286#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fdevguide%2Fissues%2F1286
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%2Fdevguide%2Fissues%2F1286
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%2Fdevguide
Reloadhttps://github.com/python/devguide/issues/1286
Reloadhttps://github.com/python/devguide/issues/1286
Reloadhttps://github.com/python/devguide/issues/1286
pythonhttps://github.com/python
devguidehttps://github.com/python/devguide
Codehttps://github.com/python/devguide
Issues83 (83)https://github.com/python/devguide/issues
Pull requests41 (41)https://github.com/python/devguide/pulls
Actionshttps://github.com/python/devguide/actions
Projectshttps://github.com/python/devguide/projects
Security and qualityhttps://github.com/python/devguide/security
Insightshttps://github.com/python/devguide/insights
https://github.com/python/devguide
New issuehttps://github.com/login?return_to=https://github.com/python/devguide/issues/1286
New issuehttps://github.com/login?return_to=https://github.com/python/devguide/issues/1286
Document how to add a bytecode specializationhttps://github.com/python/devguide/issues/1286#top
good first issueNew contributorshttps://github.com/python/devguide/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
help wantedhttps://github.com/python/devguide/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
https://github.com/Fidget-Spinner
Fidget-Spinnerhttps://github.com/Fidget-Spinner
on Mar 6, 2024https://github.com/python/devguide/issues/1286#issue-2172056425
https://github.com/python/cpython/pull/116385/fileshttps://github.com/python/cpython/pull/116385/files
hugovkhttps://github.com/hugovk
help wantedhttps://github.com/python/devguide/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
good first issueNew contributorshttps://github.com/python/devguide/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
on Mar 6, 2024https://github.com/python/devguide/issues/1286#event-12032117510
https://github.com/AbudiMutamba
AbudiMutambahttps://github.com/AbudiMutamba
on Oct 10, 2024https://github.com/python/devguide/issues/1286#issuecomment-2405096521
https://github.com/willingc
willingchttps://github.com/willingc
on Oct 10, 2024https://github.com/python/devguide/issues/1286#issuecomment-2405837362
@AbudiMutambahttps://github.com/AbudiMutamba
@Fidget-Spinnerhttps://github.com/Fidget-Spinner
https://github.com/Fidget-Spinner
Fidget-Spinnerhttps://github.com/Fidget-Spinner
on Oct 10, 2024https://github.com/python/devguide/issues/1286#issuecomment-2405875163
https://github.com/willingc
willingchttps://github.com/willingc
on Oct 10, 2024https://github.com/python/devguide/issues/1286#issuecomment-2405887957
@Fidget-Spinnerhttps://github.com/Fidget-Spinner
@AbudiMutambahttps://github.com/AbudiMutamba
https://github.com/faizanoor3001
faizanoor3001https://github.com/faizanoor3001
on Feb 20, 2025https://github.com/python/devguide/issues/1286#issuecomment-2671730062
@willingchttps://github.com/willingc
https://github.com/Fidget-Spinner
Fidget-Spinnerhttps://github.com/Fidget-Spinner
on Feb 20, 2025https://github.com/python/devguide/issues/1286#issuecomment-2671777391
@faizanoor3001https://github.com/faizanoor3001
https://github.com/faizanoor3001
faizanoor3001https://github.com/faizanoor3001
on Feb 24, 2025https://github.com/python/devguide/issues/1286#issuecomment-2679295535
@Fidget-Spinnerhttps://github.com/Fidget-Spinner
Interpreter.md sectionhttps://github.com/python/cpython/blob/main/InternalDocs/interpreter.md
https://private-user-images.githubusercontent.com/33007795/416326178-5b1083ff-3709-48a2-8c3b-8e809f48263f.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUyOTEyODksIm5iZiI6MTc5NTI5MDk4OSwicGF0aCI6Ii8zMzAwNzc5NS80MTYzMjYxNzgtNWIxMDgzZmYtMzcwOS00OGEyLThjM2ItOGU4MDlmNDgyNjNmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjExMjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYxMTIxVDE5NTYyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU4ZTZjNGUwNDE1YzI1NDNkMmM3ZjRmNzc3Mjc0OGVlMGNiNGU5YmMzYTQ4ZmUzZjUyNTE5ZDAzOGRlNWIzMzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.Jiz5WTUkujoV10ve0CfRA4m1Ya3TifnDX2E9MDRKM9g
https://private-user-images.githubusercontent.com/33007795/416327909-8cde5b70-0ebf-402b-b19e-cdcb35966e07.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUyOTEyODksIm5iZiI6MTc5NTI5MDk4OSwicGF0aCI6Ii8zMzAwNzc5NS80MTYzMjc5MDktOGNkZTViNzAtMGViZi00MDJiLWIxOWUtY2RjYjM1OTY2ZTA3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjExMjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYxMTIxVDE5NTYyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYyYmQ1MDE4ODI4ODA4MWFiMGQ0MjdlYmZmYTJlYzdmMDgyMzNlNTIyMTZiNjMyZDEyZDkwYjM5N2MwZmE4OTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.FIO5bj3x2rCvvA9kbXZ-TkdxPy7oYbVijK5g0JG-O9Q
https://github.com/Fidget-Spinner
Fidget-Spinnerhttps://github.com/Fidget-Spinner
on Feb 24, 2025https://github.com/python/devguide/issues/1286#issuecomment-2679314480
@faizanoor3001https://github.com/faizanoor3001
https://github.com/faizanoor3001
faizanoor3001https://github.com/faizanoor3001
on Mar 4, 2025https://github.com/python/devguide/issues/1286#issuecomment-2697446797
@Fidget-Spinnerhttps://github.com/Fidget-Spinner
gh-1286https://github.com/python/devguide/issues/1286
https://github.com/StanFromIreland
StanFromIrelandhttps://github.com/StanFromIreland
on Feb 21, 2026https://github.com/python/devguide/issues/1286#issuecomment-3938891073
InternalDocshttps://github.com/python/cpython/tree/main/InternalDocs
https://github.com/nayanraj864-cmyk
nayanraj864-cmykhttps://github.com/nayanraj864-cmyk
on Sep 8, 2026https://github.com/python/devguide/issues/1286#issuecomment-5589641945
https://github.com/pushkarkurkure172-crypto
pushkarkurkure172-cryptohttps://github.com/pushkarkurkure172-crypto
on Oct 29, 2026https://github.com/python/devguide/issues/1286#issuecomment-6510971262
@Fidget-Spinnerhttps://github.com/Fidget-Spinner
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/devguide/issues/1286
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/devguide/issues/1286
good first issueNew contributorshttps://github.com/python/devguide/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
help wantedhttps://github.com/python/devguide/issues?q=state%3Aopen%20label%3A%22help%20wanted%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.