Use interned versions of string constants if they're already present
オープン
まだ誰も着手していません。
easy
interpreter-core
performance
type-feature
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Feature or enhancement
Proposal:
For now intern_constants function in Objects/codeobject.c uses should_intern_string to check if that string should be interned. And do nothing if should_intern_string returned 0. Maybe it'll be better to check if this string already have interned variant and use it if present? Because there's no need to keep equal strings in memory. The small downside is some time needed for this checking.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-140688
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Objects/codeobject.c の intern_constants から始め、should_intern_string が現在どのように文字列を intern するかどうかを判断しているかを追跡してください。開始前にリンクされている PR gh-140688 を確認し、既存の intern 済みの同値な文字列が再利用され、重複する等しい文字列が保持されなくなった時点で作業完了としてください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, python
- 領域
- backend, performance
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100