`_PyStaticCode_InternStrings` is called ~800 times during startup.
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 領域
- backend, performance
調査の方向性
まず _Py_Deepfreeze_Init() と、そこから _PyStaticCode_InternStrings が呼び出される箇所を追跡します。インターン済み文字列の辞書と文字列のハッシュコードがどのように初期化されるかを確認し、そのうえで、提案されている一括構築が必要な辞書の状態と起動時の動作を維持するかどうかを判断します。
索引モデルが issue の本文から書いたものです。
説明
The _Py_Deepfreeze_Init() function calls _PyStaticCode_InternStrings once for each string.
Creating the interned string dict in one go, from the table of static strings would be much faster.
something like this (error checking omitted, and other liberties taken for brevity)
_Py_CreateInternedDict(PyObject **strs, int n) {
PyDictKeys *table = make_dict_keys(n);
for (int i = 0; i < n; i++) {
table->entries[i].key = table->entries[i].value = strs[i];
table->entries[i].hashcode = strs[i].hash_code;
// Fix up size and entries here.
}
return new_dict(table);
}
All the hash codes will need to be initialized first, but we probably should do that anyway.
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 558
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/cpython のほかの issue
-
docs pending
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
build type-bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
stdlib topic-email type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
似ている issue
-
area/auth bug comp/agent P3 platform/discord type/security
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NousResearch/hermes-agent#117848 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
bancolombia/sentinel#23 ·
-
test md オープンCI
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
langchain-ai/deepagents#6450 ·
-
bug client
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100