Title: Optimize float operations by mutating uniquely-referenced operands in place (JIT only) · Issue #146306 · python/cpython · GitHub
Open Graph Title: Optimize float operations by mutating uniquely-referenced operands in place (JIT only) · Issue #146306 · python/cpython
X Title: Optimize float operations by mutating uniquely-referenced operands in place (JIT only) · Issue #146306 · python/cpython
Description: Feature or enhancement Proposal: When the tier 2 optimizer can prove that an operand to a float binary operation is uniquely referenced, we can mutate it in place instead of allocating a new PyFloatObject. This avoids a PyFloat_FromDoubl...
Open Graph Description: Feature or enhancement Proposal: When the tier 2 optimizer can prove that an operand to a float binary operation is uniquely referenced, we can mutate it in place instead of allocating a new PyFloa...
X Description: Feature or enhancement Proposal: When the tier 2 optimizer can prove that an operand to a float binary operation is uniquely referenced, we can mutate it in place instead of allocating a new PyFloa...
Opengraph URL: https://github.com/python/cpython/issues/146306
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Optimize float operations by mutating uniquely-referenced operands in place (JIT only)","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nWhen the tier 2 optimizer can prove that an operand to a float binary operation is uniquely referenced, we can mutate it in place instead of allocating a new `PyFloatObject`. This avoids a `PyFloat_FromDouble` allocation and the subsequent deallocation of the consumed operand on every iteration.\n\nThe unique reference tracking infrastructure added in #144300 can be used for the float operations as well. Also see #90530 where a similar optimization was proposed for tier 1 using runtime refcount checks.\n\n\n### Has this already been discussed elsewhere?\n\nNo response given\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-146307\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/eendebakpt","@type":"Person","name":"eendebakpt"},"datePublished":"2026-03-22T19:48:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/146306/cpython/issues/146306"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b4e05348-6571-b366-9464-d5a12e9d7224 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C504:2E11B4:2E6422:3DE448:6A50748C |
| html-safe-nonce | e18a76c9892d4be45d5937117bcf84eee710f192891064f63ecd0d661c14179d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTA0OjJFMTFCNDoyRTY0MjI6M0RFNDQ4OjZBNTA3NDhDIiwidmlzaXRvcl9pZCI6IjI5MTQ1MDc5MTY1ODU1MDQxMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 49a9001fd59f7b0b72e851e9ccd5edb54bc6d60579da23145c7314ac1882f274 |
| hovercard-subject-tag | issue:4116944443 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/cpython/146306/issue_layout |
| twitter:image | https://opengraph.githubassets.com/75f87abb55fcc94dd8d2b117f6b64533447b86f561ac99bc3cb0701346f94dca/python/cpython/issues/146306 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/75f87abb55fcc94dd8d2b117f6b64533447b86f561ac99bc3cb0701346f94dca/python/cpython/issues/146306 |
| og:image:alt | Feature or enhancement Proposal: When the tier 2 optimizer can prove that an operand to a float binary operation is uniquely referenced, we can mutate it in place instead of allocating a new PyFloa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | eendebakpt |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width