Title: Dataflow analysis in the compiler to avoid runtime NULL checks · Issue #93143 · python/cpython · GitHub
Open Graph Title: Dataflow analysis in the compiler to avoid runtime NULL checks · Issue #93143 · python/cpython
X Title: Dataflow analysis in the compiler to avoid runtime NULL checks · Issue #93143 · python/cpython
Description: LOAD_FAST accounts for 14.6% of all bytecodes executed. Including superinstructions brings this up to 14.6+4.7+4.6+2.4+0.9 = 27.1% cpython/Python/ceval.c Lines 1864 to 1872 in 202ed25 TARGET(LOAD_FAST) { PyObject *value = GETLOCAL(oparg)...
Open Graph Description: LOAD_FAST accounts for 14.6% of all bytecodes executed. Including superinstructions brings this up to 14.6+4.7+4.6+2.4+0.9 = 27.1% cpython/Python/ceval.c Lines 1864 to 1872 in 202ed25 TARGET(LOAD_F...
X Description: LOAD_FAST accounts for 14.6% of all bytecodes executed. Including superinstructions brings this up to 14.6+4.7+4.6+2.4+0.9 = 27.1% cpython/Python/ceval.c Lines 1864 to 1872 in 202ed25 TARGET(LOAD_F...
Opengraph URL: https://github.com/python/cpython/issues/93143
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Dataflow analysis in the compiler to avoid runtime NULL checks","articleBody":"`LOAD_FAST` accounts for [14.6%](https://github.com/faster-cpython/ideas/blob/main/stats.md) of all bytecodes executed. Including superinstructions brings this up to 14.6+4.7+4.6+2.4+0.9 = 27.1%\r\n\r\nhttps://github.com/python/cpython/blob/202ed2506c84cd98e9e35621b5b2929ceb717864/Python/ceval.c#L1864-L1872\r\n\r\nWe can turn this NULL-check into an assertion in many cases, where we can determine at compile time that the local variable is already initialized. Preliminary tests show that almost all `LOAD_FAST` instructions can be statically analyzed to be loading already-initialized variables.\r\n\r\nThe one twist is handling `del frame.f_locals[\"x\"]` or `frame.f_lineno = 17`, where previously-safe loads could become unsafe. For now, we can just replace all the `LOAD_FAST (no null check)` with `LOAD_FAST_CHECK` in that particular code object.\r\n\r\nSee also https://github.com/faster-cpython/ideas/discussions/306\n\n\u003c!-- gh-pr-number: gh-99075 --\u003e\n* PR: gh-99075\n\u003c!-- /gh-pr-number --\u003e\n","author":{"url":"https://github.com/sweeneyde","@type":"Person","name":"sweeneyde"},"datePublished":"2022-05-23T18:32:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/93143/cpython/issues/93143"}
| 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:8ab08d63-9bb6-c6e4-8c27-bf81e134d214 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C7E2:12EEDE:35BCEA:490AE5:6969AB8E |
| html-safe-nonce | ac800a7d0f36d341f7770c8ecf06e314335976fe0112616f446b7a93bb7eade0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0UyOjEyRUVERTozNUJDRUE6NDkwQUU1OjY5NjlBQjhFIiwidmlzaXRvcl9pZCI6IjU2NDU5Nzg2NDY4OTE1NzIxMTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 880afe846773fc683b670fd5a435f2e6ce3a73934dfe083c62c1d564b6c781ba |
| hovercard-subject-tag | issue:1245553871 |
| 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/93143/issue_layout |
| twitter:image | https://opengraph.githubassets.com/df746f83f1a9c62aa643a78e3cb47f39b44c1a8723ba9d486998317e8595c758/python/cpython/issues/93143 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/df746f83f1a9c62aa643a78e3cb47f39b44c1a8723ba9d486998317e8595c758/python/cpython/issues/93143 |
| og:image:alt | LOAD_FAST accounts for 14.6% of all bytecodes executed. Including superinstructions brings this up to 14.6+4.7+4.6+2.4+0.9 = 27.1% cpython/Python/ceval.c Lines 1864 to 1872 in 202ed25 TARGET(LOAD_F... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sweeneyde |
| hostname | github.com |
| expected-hostname | github.com |
| None | 24c4c97a2d520cb286b35e1a4c22d7a4df3c26a2fa28dd7cdf0e65db327b4de7 |
| 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 | 124667f43168afb6c9c03b7c02eb5b1d2e1be3d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width