René's URL Explorer Experiment


Title: gh-77273: Better bytecodes for f-strings by markshannon · Pull Request #6132 · python/cpython · GitHub

Open Graph Title: gh-77273: Better bytecodes for f-strings by markshannon · Pull Request #6132 · python/cpython

X Title: gh-77273: Better bytecodes for f-strings by markshannon · Pull Request #6132 · python/cpython

Description: Simplify and speed up interpreter for f-strings. tldr; Do work in the compiler instead of the interpreter. Splits the FORMAT_VALUE opcode into CONVERT_VALUE, FORMAT_SIMPLE and FORMAT_WITH_SPEC. The compiler can then emit the optimal sequence for each format expression. The three new opcodes are much simpler than the one they replace, actually removing a few lines of code from the interpreter. The CONVERT_VALUE is emitted only if a conversion is present. In the standard library only (approx) 20% of f-strings include a conversion. FORMAT_WITH_SPEC is emitted if a format specifier is present. Otherwise FORMAT_SIMPLE is emitted. In the standard library about 70% of format expressions can be formatted with just the simple (and fast) FORMAT_SIMPLE opcode. https://bugs.python.org/issue33092 Issue: gh-77273

Open Graph Description: Simplify and speed up interpreter for f-strings. tldr; Do work in the compiler instead of the interpreter. Splits the FORMAT_VALUE opcode into CONVERT_VALUE, FORMAT_SIMPLE and FORMAT_WITH_SPEC. The...

X Description: Simplify and speed up interpreter for f-strings. tldr; Do work in the compiler instead of the interpreter. Splits the FORMAT_VALUE opcode into CONVERT_VALUE, FORMAT_SIMPLE and FORMAT_WITH_SPEC. The...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:a58ce151-d4a5-f85e-bcdf-22022038cdf8
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9AB2:36419E:1CA61E:25B422:696AD7A7
html-safe-nonceb25a15e77e66fb916f18857af1e9bd7d57f8ba2515e9f639c68e66de3eeb7f7e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUIyOjM2NDE5RToxQ0E2MUU6MjVCNDIyOjY5NkFEN0E3IiwidmlzaXRvcl9pZCI6IjIyMzc3MjM0MTY2MjM1MDMyNzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacbf3a05a0cada725defd31d5a931721b2b64c2d3c2bcb597c8cc958f295b23e07
hovercard-subject-tagpull_request:175699550
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/6132/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:altSimplify and speed up interpreter for f-strings. tldr; Do work in the compiler instead of the interpreter. Splits the FORMAT_VALUE opcode into CONVERT_VALUE, FORMAT_SIMPLE and FORMAT_WITH_SPEC. The...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
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
release524a93f2c1f36522a3b4be4c110467ee4172245d
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/6132/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F6132%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%2F6132%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/6132/files
Reloadhttps://github.com/python/cpython/pull/6132/files
Reloadhttps://github.com/python/cpython/pull/6132/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/6132/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/6132/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
markshannon:better-bytecode-fstringhttps://github.com/markshannon/cpython/tree/better-bytecode-fstring
Conversation 10 https://github.com/python/cpython/pull/6132
Commits 6 https://github.com/python/cpython/pull/6132/commits
Checks 0 https://github.com/python/cpython/pull/6132/checks
Files changed https://github.com/python/cpython/pull/6132/files
Please reload this pagehttps://github.com/python/cpython/pull/6132/files
gh-77273: Better bytecodes for f-strings https://github.com/python/cpython/pull/6132/files#top
Show all changes 6 commits https://github.com/python/cpython/pull/6132/files
3af4084 Avoid conditional stack effects when compiling f-strings. markshannon Jun 5, 2023 https://github.com/python/cpython/pull/6132/commits/3af4084473987db662420ec46622f983188a1d79
a84bd65 Merge branch 'main' into better-bytecode-fstring markshannon Jun 5, 2023 https://github.com/python/cpython/pull/6132/commits/a84bd65921b717c3369e96557bd6cd099151220f
b6d7171 Fix up magic number. markshannon Jun 5, 2023 https://github.com/python/cpython/pull/6132/commits/b6d71713a37f139ff06bf44981e189c6d0593c0f
62a3404 Document new instructions. markshannon Jun 5, 2023 https://github.com/python/cpython/pull/6132/commits/62a340404047755e43e7dda44029a4eedfcb19cb
31385d1 Merge branch 'main' into better-bytecode-fstring markshannon Jun 9, 2023 https://github.com/python/cpython/pull/6132/commits/31385d1a8ae054d10a89869400bb9ed0ce73317c
641466c Merge branch 'main' into better-bytecode-fstring markshannon Jun 9, 2023 https://github.com/python/cpython/pull/6132/commits/641466c91ed0d16d61b1283d23238172ff95ec45
Clear filters https://github.com/python/cpython/pull/6132/files
Please reload this pagehttps://github.com/python/cpython/pull/6132/files
Please reload this pagehttps://github.com/python/cpython/pull/6132/files
dis.rst https://github.com/python/cpython/pull/6132/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
pycore_opcode.h https://github.com/python/cpython/pull/6132/files#diff-7b986d4fccffcb2f2af4ec495559b2f0dc2e393e38f95e8ca3ef48e559177530
opcode.h https://github.com/python/cpython/pull/6132/files#diff-1cd1f0bb26c3fbaa279f83ee2bfe1d9072da7af07407111c79039c66034c57ed
dis.py https://github.com/python/cpython/pull/6132/files#diff-96747735ee3c8aed3dd0f4c1b1ab0310eeb344577b14887cc9f6605892df47a8
_bootstrap_external.py https://github.com/python/cpython/pull/6132/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
opcode.py https://github.com/python/cpython/pull/6132/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
test_dis.py https://github.com/python/cpython/pull/6132/files#diff-fd7b118a01a9695dfa16eea9381d3c7b0652e1b7b55f51ff052a1f620d175642
2023-06-05-08-30-49.gh-issue-33092.hZ0xSI.rst https://github.com/python/cpython/pull/6132/files#diff-ea9c7c336aedd0e3410722667302435ec9989cf6850bcb628759f98f50c343ee
test_frozenmain.h https://github.com/python/cpython/pull/6132/files#diff-dcbbf153f77c69fb3a08746516bb9baaf46b9465c941221d1d495123e92cc862
bytecodes.c https://github.com/python/cpython/pull/6132/files#diff-729a985b0cb8b431cb291f1edb561bbbfea22e3f8c262451cd83328a0936a342
ceval.c https://github.com/python/cpython/pull/6132/files#diff-c22186367cbe20233e843261998dc027ae5f1f8c0d2e778abfa454ae74cc59de
compile.c https://github.com/python/cpython/pull/6132/files#diff-ebc983d9f91e5bcf73500e377ac65e85863c4f77fd5b6b6caf4fcdf7c0f0b057
generated_cases.c.h https://github.com/python/cpython/pull/6132/files#diff-4ef46fa654f95502e49a24f7dc8ee31a4cac9b3433fe9cd2b2d4dd78cfbad448
opcode_metadata.h https://github.com/python/cpython/pull/6132/files#diff-f862bc60824529a25ba378be850ecc6762f03c6c944266d30ac7172d10132498
opcode_targets.h https://github.com/python/cpython/pull/6132/files#diff-d3363a4083b77b9157d0bf07c2e87f3d3464a8b4360d5d23b07bbb23061f007a
Doc/library/dis.rsthttps://github.com/python/cpython/pull/6132/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
View file https://github.com/markshannon/cpython/blob/641466c91ed0d16d61b1283d23238172ff95ec45/Doc/library/dis.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/6132/{{ revealButtonHref }}
https://github.com/python/cpython/pull/6132/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
https://github.com/python/cpython/pull/6132/files#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653b
Include/internal/pycore_opcode.hhttps://github.com/python/cpython/pull/6132/files#diff-7b986d4fccffcb2f2af4ec495559b2f0dc2e393e38f95e8ca3ef48e559177530
View file https://github.com/markshannon/cpython/blob/641466c91ed0d16d61b1283d23238172ff95ec45/Include/internal/pycore_opcode.h
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/cpython/pull/6132/files
Include/opcode.hhttps://github.com/python/cpython/pull/6132/files#diff-1cd1f0bb26c3fbaa279f83ee2bfe1d9072da7af07407111c79039c66034c57ed
View file https://github.com/markshannon/cpython/blob/641466c91ed0d16d61b1283d23238172ff95ec45/Include/opcode.h
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/cpython/pull/6132/files
Lib/dis.pyhttps://github.com/python/cpython/pull/6132/files#diff-96747735ee3c8aed3dd0f4c1b1ab0310eeb344577b14887cc9f6605892df47a8
View file https://github.com/markshannon/cpython/blob/641466c91ed0d16d61b1283d23238172ff95ec45/Lib/dis.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/6132/{{ revealButtonHref }}
https://github.com/python/cpython/pull/6132/files#diff-96747735ee3c8aed3dd0f4c1b1ab0310eeb344577b14887cc9f6605892df47a8
https://github.com/python/cpython/pull/6132/files#diff-96747735ee3c8aed3dd0f4c1b1ab0310eeb344577b14887cc9f6605892df47a8
https://github.com/python/cpython/pull/6132/files#diff-96747735ee3c8aed3dd0f4c1b1ab0310eeb344577b14887cc9f6605892df47a8
iritkatrielhttps://github.com/iritkatriel
Jun 8, 2023https://github.com/python/cpython/pull/6132/files#r1223255155
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/6132/files
markshannonhttps://github.com/markshannon
Jun 14, 2023https://github.com/python/cpython/pull/6132/files#r1229469114
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/6132/files
iritkatrielhttps://github.com/iritkatriel
Jun 14, 2023https://github.com/python/cpython/pull/6132/files#r1229473616
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/6132/files
markshannonhttps://github.com/markshannon
Jun 14, 2023https://github.com/python/cpython/pull/6132/files#r1229480741
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/6132/files
https://github.com/python/cpython/pull/6132/files#diff-96747735ee3c8aed3dd0f4c1b1ab0310eeb344577b14887cc9f6605892df47a8
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L260
Lib/importlib/_bootstrap_external.pyhttps://github.com/python/cpython/pull/6132/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
View file https://github.com/markshannon/cpython/blob/641466c91ed0d16d61b1283d23238172ff95ec45/Lib/importlib/_bootstrap_external.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/6132/{{ revealButtonHref }}
https://github.com/python/cpython/pull/6132/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
https://github.com/python/cpython/pull/6132/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
https://github.com/python/cpython/pull/6132/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
Lib/opcode.pyhttps://github.com/python/cpython/pull/6132/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
View file https://github.com/markshannon/cpython/blob/641466c91ed0d16d61b1283d23238172ff95ec45/Lib/opcode.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/6132/{{ revealButtonHref }}
https://github.com/python/cpython/pull/6132/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
https://github.com/python/cpython/pull/6132/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
https://github.com/python/cpython/pull/6132/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
https://github.com/python/cpython/pull/6132/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
Please reload this pagehttps://github.com/python/cpython/pull/6132/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.