Do we still need `asciilib` for better performance?
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- リファクタリング
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 領域
- performance
調査の方向性
unicode_countで使用されるasciilib_count呼び出しと、asciilib_rsplit_whitespaceのパスから始め、Windows、macOS、LinuxでASCII入力と非ASCII入力を比較します。短い文字列と長い文字列を使って、影響を受けるPythonメソッドとC API関数を測定します。完了の条件は、呼び出しを残すべきか削除すべきかを判断できる十分なベンチマーク結果を得ることです。
索引モデルが issue の本文から書いたものです。
説明
Feature or enhancement
asciilib was introduced in https://github.com/python/cpython/commit/c3cec7868bf1019c0987f1e9aadb56d73fa93d61 as a performance feature for ascii strings.
11 years have passed since then.
While working on https://github.com/python/cpython/pull/98025 we with @vstinner experimented on unicode_count with and without asciilib_count calls.
Results were clear: it does not bring any benefits on our benchmarks.
And this commit was made: https://github.com/python/cpython/commit/df3a6d9beb8a7a3fe87a6d4126384fd3e0213853
Later, while working on https://github.com/python/cpython/pull/98228 I've noticed that asciilib_rsplit_whitespace also does not provide significant performance gains on my platform and my simple data input.
So, maybe this should be analyzed deeply?
Pitch
- I think that these calls should be further investigated: do we really need this?
- We should come up with better data to make a final decision, including:
-
- What pytohn methods / c-api functions are affected?
-
- Short and long ascii / non-ascii strings (because this check slows down all non-ascii strings by calling extra
PyUnicode_IS_ASCII(str)
- Short and long ascii / non-ascii strings (because this check slows down all non-ascii strings by calling extra
-
- Windows / MacOS / Linux platforms, maybe the results will be different
I don't have access to Windows, but I can do the research for other platforms.
If it does not provide any performance benefits, it should be removed.
- 主要言語
- 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
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
zostera/django-bootstrap4#894 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
use-agent-os/agent-os#3276 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NousResearch/hermes-agent#117848 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
zilliztech/memsearch#759 ·