python / python/cpython

Compiling executors can result in excessively large amounts of machine code.

未關閉
#141,794 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

interpreter-core performance topic-JIT type-feature
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

With the tracing front-end to the JIT we are producing longer traces than before.
This should be good, but results in very large chunks of machine code.
Large chunks of machine code are bad because:

  • It takes longer and uses more memory
  • It puts a lot of pressure on the icache, possibly evicting the interpreter
  • It makes handling of inline data and branches less efficient as the targets are further away.

To be clear, the problem is not the number of uops per trace, but the amount of machine code per uop.

Things we can do to fix this:

  • Move code into helper functions for the larger uops
  • Move complex decref sequences for DECREF_INPUTS() into helper functions.

(We can also do more optimizations to remove more uops, but that's a separate issue and we're doing it anyway)

Linked PRs
  • gh-142228
  • gh-142263
  • gh-142257
  • gh-142386
  • gh-142409

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

未指定原始檔案、測試或進入點。先檢視已連結的 PR gh-142228、gh-142263、gh-142257、gh-142386 和 gh-142409,了解它們處理已編譯執行器和 DECREF_INPUTS() 的哪些部分。完成的標準是在不改變執行器行為的情況下縮減機器碼大小,且相關測試或基準測試通過。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
compilers, performance
Issue 類型
缺陷
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
基本清楚
新手友好度
20/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。