Improve performance of `find_max_char`
オープン
まだ誰も着手していません。
performance
type-feature
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Feature or enhancement
Proposal:
find_max_char is called each time a string is created.
By reducing the amount of tests, the performance can be improved considerably.
python -m pyperf timeit -s "b=('a' *1000+ '\u019f'*2)" "b[:-1]"
+-----------+--------+----------------------+
| Benchmark | ref | patch |
+===========+========+======================+
| timeit | 442 ns | 388 ns: 1.14x faster |
+-----------+--------+----------------------+
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
- gh-122902
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず CPython にある find_max_char の実装を見つけ、現在の動作で提供された pyperf コマンドを実行します。ベンチマーク結果を、報告されている 442 ns のリファレンスおよび 388 ns のパッチ結果と比較します。縮小されたテスト方法によってパフォーマンスが向上し、文字列の作成動作が変わっていなければ完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- performance
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 30/100