Serhiy Storchaka added the comment:
I got following result:
$ ./python.patched -m perf timeit --compare-to=./python.default --duplicate=100
-- '{}'
python.default: ..................... 203 ns +- 5 ns
python.patched: ..................... 97.1 ns +- 0.7 ns
Mean +- std dev: [python.default] 203 ns +- 5 ns -> [python.patched] 97.1 ns +-
0.7 ns: 2.09x faster (-52%)
$ ./python.patched -m perf timeit --compare-to=./python.default --duplicate=100
-- 'x={}; x[1]=1'
python.default: ..................... 494 ns +- 5 ns
python.patched: ..................... 592 ns +- 7 ns
Mean +- std dev: [python.default] 494 ns +- 5 ns -> [python.patched] 592 ns +-
7 ns: 1.20x slower (+20%)
Seems something is wrong with resizing an empty dict. It shouldn't take such
much time.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue30040>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com