Title: Bytecode compile times are `O(nlocals**2)` · Issue #97912 · python/cpython · GitHub
Open Graph Title: Bytecode compile times are `O(nlocals**2)` · Issue #97912 · python/cpython
X Title: Bytecode compile times are `O(nlocals**2)` · Issue #97912 · python/cpython
Description: @JelleZijlstra discovered something interesting yesterday: bytecode compile times on main are currently quadratic in the number of local variables (3.11 is still linear). For example, a function with 100,000 assignments to unique local v...
Open Graph Description: @JelleZijlstra discovered something interesting yesterday: bytecode compile times on main are currently quadratic in the number of local variables (3.11 is still linear). For example, a function wi...
X Description: @JelleZijlstra discovered something interesting yesterday: bytecode compile times on main are currently quadratic in the number of local variables (3.11 is still linear). For example, a function wi...
Opengraph URL: https://github.com/python/cpython/issues/97912
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bytecode compile times are `O(nlocals**2)`","articleBody":"@JelleZijlstra discovered something interesting yesterday: bytecode compile times on `main` are currently quadratic in the number of local variables (`3.11` is still linear). For example, a function with 100,000 assignments to unique local variables takes well over a minute to compile (but is less than 2 seconds on 3.11).\r\n\r\nI believe the culprit is the new `LOAD_FAST`/`LOAD_FAST_CHECK` stuff. The current implementation appears to loop over every local variable, and for each one, loop over all bytecode instructions. This can probably be refactored to run in one pass for all locals.\r\n\r\nCC: @markshannon @sweeneyde","author":{"url":"https://github.com/brandtbucher","@type":"Person","name":"brandtbucher"},"datePublished":"2022-10-05T17:01:53Z","url":"https://github.com/python/cpython/issues/97912"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9f3286a1-e80b-9a1a-9189-d49f0a3e7adc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D85C:2F543F:16826F5:1DC3310:6B020252 |
| html-safe-nonce | 909c37fbaed43bdce59a5630d8282862ba66ade6acbf7ed0a5dd5d95ed1668d0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODVDOjJGNTQzRjoxNjgyNkY1OjFEQzMzMTA6NkIwMjAyNTIiLCJ2aXNpdG9yX2lkIjoiNjYzNTgwNDEwMjgwODk2MTYxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 04886396cc15cae2c505b16a3c7614af36d0ffcae2fce5472f87cdf38c0c8746 |
| hovercard-subject-tag | issue:1398101011 |
| 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/97912/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6def688485ead689f8765a0d8c6f0d728d332bb3a3c6c240d5b37c9c1f9da7ec/python/cpython/issues/97912 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6def688485ead689f8765a0d8c6f0d728d332bb3a3c6c240d5b37c9c1f9da7ec/python/cpython/issues/97912 |
| og:image:alt | @JelleZijlstra discovered something interesting yesterday: bytecode compile times on main are currently quadratic in the number of local variables (3.11 is still linear). For example, a function wi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | brandtbucher |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width