[issue27358] BUILD_MAP_UNPACK_WITH_CALL is slow

Serhiy Storchaka report at bugs.python.org
Fri Sep 23 11:31:57 EDT 2016


Serhiy Storchaka added the comment:

Microbenchmarks:

$ ./python -m timeit -s "def f(**kw): pass" -s "b = {'b': 2}" -- "f(a=1, **b)"
Unpatched:  100000 loops, best of 3: 7.64 usec per loop
Patched:    100000 loops, best of 3: 3.14 usec per loop

$ ./python -m timeit -s "def f(**kw): pass" -s "a = {'a': 1}; b = {'b': 2}" -- "f(**a, **b)"
Unpatched:  100000 loops, best of 3: 6.93 usec per loop
Patched:    100000 loops, best of 3: 2.66 usec per loop

$ ./python -m timeit -s "def f(a=None, b=None): pass" -s "b = {'b': 2}" -- "f(a=1, **b)"
Unpatched:  100000 loops, best of 3: 7.27 usec per loop
Patched:    100000 loops, best of 3: 2.83 usec per loop

$ ./python -m timeit -s "def f(a=None, b=None): pass" -s "a = {'a': 1}; b = {'b': 2}" -- "f(**a, **b)"
Unpatched:  100000 loops, best of 3: 6.47 usec per loop
Patched:    100000 loops, best of 3: 2.31 usec per loop

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27358>
_______________________________________


More information about the Python-bugs-list mailing list