Serhiy Storchaka <[email protected]> added the comment:
As a side effect it slightly optimizes parsing non-ASCII numbers.
$ ./python -m perf timeit --compare-to=./python0 'int("۱۲۳۴۵۶۷۸۹")'
--duplicate 100
python0: ..................... 277 ns +- 3 ns
python: ..................... 225 ns +- 3 ns
Mean +- std dev: [python0] 277 ns +- 3 ns -> [python] 225 ns +- 3 ns: 1.23x
faster (-19%)
$ ./python -m perf timeit --compare-to=./python0 'float("۱۲۳۴۵.۶۷۸۹")'
--duplicate 100
python0: ..................... 256 ns +- 1 ns
python: ..................... 199 ns +- 2 ns
Mean +- std dev: [python0] 256 ns +- 1 ns -> [python] 199 ns +- 2 ns: 1.29x
faster (-22%)
$ ./python -m perf timeit --compare-to=./python0 'complex("۱۲۳۴۵.۶۷۸۹j")'
--duplicate 100
python0: ..................... 298 ns +- 4 ns
python: ..................... 235 ns +- 3 ns
Mean +- std dev: [python0] 298 ns +- 4 ns -> [python] 235 ns +- 3 ns: 1.27x
faster (-21%)
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue31979>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com