Do we still need `asciilib` for better performance?
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Refactorisation
- Clarté
- À clarifier
- Activité
- À l'abandon
- Domaine
- performance
Piste de recherche
Commencez par les appels à asciilib_count utilisés par unicode_count et par le chemin asciilib_rsplit_whitespace, en comparant des entrées ASCII et non ASCII sous Windows, macOS et Linux. Mesurez les méthodes Python et les fonctions de l’API C concernées avec des chaînes courtes et longues ; le travail est terminé lorsqu’il y a suffisamment de données de benchmark pour décider si les appels doivent être conservés ou supprimés.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 77.2k
- Forks
- 36k
- Merge moyen
- 1 j 9 h
- PR mergées (30 j)
- 558
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de python/cpython
-
docs pending
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
stdlib type-feature
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
stdlib type-feature
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
build type-bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
-
stdlib topic-email type-feature
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
Toutes les issues de python/cpython
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
zostera/django-bootstrap4#894 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
use-agent-os/agent-os#3276 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
zilliztech/memsearch#759 ·