Title: Calls across stack chunks perform badly · Issue #142183 · python/cpython · GitHub
Open Graph Title: Calls across stack chunks perform badly · Issue #142183 · python/cpython
X Title: Calls across stack chunks perform badly · Issue #142183 · python/cpython
Description: The Python stack is composed of a series of chunks of memory. These chunks are large, so we cross the boundaries infrequently and assume that it will never be on the fast path. Unfortunately, it is possible to cross the boundary repeated...
Open Graph Description: The Python stack is composed of a series of chunks of memory. These chunks are large, so we cross the boundaries infrequently and assume that it will never be on the fast path. Unfortunately, it is...
X Description: The Python stack is composed of a series of chunks of memory. These chunks are large, so we cross the boundaries infrequently and assume that it will never be on the fast path. Unfortunately, it is...
Opengraph URL: https://github.com/python/cpython/issues/142183
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Calls across stack chunks perform badly","articleBody":"The Python stack is composed of a series of chunks of memory. These chunks are large, so we cross the boundaries infrequently and assume that it will never be on the fast path.\n\nUnfortunately, it is possible to cross the boundary repeatedly if looping deep in the stack.\n\nWe should adjust the stack when crossing the boundary, to avoid doing so repeatedly.\n\nPossible options include:\n1. Move the caller to the new chunk, so repeated calls do not cross the boundary.\n2. Instead of using a chunked stack, double the size of the stack and copy the old stack.\n\nBoth of these assume that we can move the frame. This is only possible if there are no pointers into the frame.\nIf a frames calls a native function taking an array of arguments, then there will be pointers into the frame.\nSo if we do any moving, we need to check for these pointers.\n\nWhile we cannot move the frame, we can copy it, as long as the original remains. This is a bit wasteful, but shouldn't happen too often or waste too much space.\n\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-145789\n* gh-145828\n* gh-145829\n* gh-146123\n* gh-148681\n* gh-149097\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/markshannon","@type":"Person","name":"markshannon"},"datePublished":"2025-12-02T11:12:32Z","url":"https://github.com/python/cpython/issues/142183"}
| 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:45b9f3d9-7b80-2469-8c37-6dd43a9146f8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E428:23E48:73D8CE:914C91:6B021F10 |
| html-safe-nonce | a5e6a4635d99d0448b86fa78c576b0283d43bace23b48d237f075f0b6b6e73d0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDI4OjIzRTQ4OjczRDhDRTo5MTRDOTE6NkIwMjFGMTAiLCJ2aXNpdG9yX2lkIjoiMjQ4MDM1MTkxNzQwNzA4NDMwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e9ad12d93a4f6b66ed313d5f90332620c424214426b06ee07c1a7b48e06a8d43 |
| hovercard-subject-tag | issue:3685335582 |
| 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/142183/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1954b55a9dbeaccb8f3fc786f51f6098a64ba4d425c8b64beccec2d13a906022/python/cpython/issues/142183 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1954b55a9dbeaccb8f3fc786f51f6098a64ba4d425c8b64beccec2d13a906022/python/cpython/issues/142183 |
| og:image:alt | The Python stack is composed of a series of chunks of memory. These chunks are large, so we cross the boundaries infrequently and assume that it will never be on the fast path. Unfortunately, it is... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | markshannon |
| 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