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
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:705706a7-7dd2-3182-e1b5-b66f666a897e |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | D842:219A86:496161:6378CD:6969DDAB |
| html-safe-nonce | 3faa849bc971c2e961652ca42163def4ac068c77860421ddff1e325a613f2c94 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODQyOjIxOUE4Njo0OTYxNjE6NjM3OENEOjY5NjlEREFCIiwidmlzaXRvcl9pZCI6IjQ2Njg2MzE0NTM5NzUzMDU2NDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 03e08f5403af795bcd8db4a5c53476bed527a36310a3a486e58accb54bc1968a |
| hovercard-subject-tag | pull_request:175699550 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/6132/checks |
| twitter:image | https://avatars.githubusercontent.com/u/9448417?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/9448417?s=400&v=4 |
| og:image:alt | 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... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width