Move stackref buffer to per-eval loop to reduce interp stack usage
未關閉
還沒有人認領這個 Issue。
3.14
3.15
interpreter-core
type-feature
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 35.9k
- PR 合併指標
- PR 指標待擷取
描述
Feature or enhancement
Proposal:
The interpreter main loop's stack usage is huge. We should try to reduce it a little. Currently, the stackref buffer takes up 10 words on 64-bit machines. We could lessen that by moving it to the heap (thread state).
This might mean slightly less perf due to worse locality and one memory indirection. So let's benchmark this to be sure.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-138116
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從直譯器主迴圈開始,找出提案中提到的 stackref 緩衝區和執行緒狀態。對目前的配置和提議的配置進行基準測試,包括堆疊使用量、區域性或間接存取成本,以及效能。只有在測量結果支持這項變更時,才依照提案移動 stackref 緩衝區;完成意味著這一點;gh-138116 表示相關工作已經在進行中。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- compilers
- Issue 類型
- 功能
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100