[issue32226] Implement PEP 560: Core support for typing module and generic types

Serhiy Storchaka report at bugs.python.org
Thu Dec 14 07:22:24 EST 2017


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

This adds an overhead to every indexing.

$ ./python -m perf timeit --compare-to=./python0 -s 'a = [1]' --duplicate=10000 'a[0]'
python0: ..................... 15.3 ns +- 0.5 ns
python: ..................... 16.1 ns +- 0.3 ns

Mean +- std dev: [python0] 15.3 ns +- 0.5 ns -> [python] 16.1 ns +- 0.3 ns: 1.05x slower (+5%)

$ ./python -m perf timeit --compare-to=./python0 -s 'd = {1: 2}' --duplicate=10000 'd[1]'
python0: ..................... 17.6 ns +- 0.6 ns
python: ..................... 18.4 ns +- 0.5 ns

Mean +- std dev: [python0] 17.6 ns +- 0.6 ns -> [python] 18.4 ns +- 0.5 ns: 1.05x slower (+5%)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32226>
_______________________________________


More information about the Python-bugs-list mailing list