INADA Naoki added the comment:

I'm sorry, dict.fromkeys() didn't use PyDict_MergeFromSeq2().

This may be microbench for worst case:

$ ~/local/py35/bin/master -m perf timeit --rigorous  --python 
~/local/py35/bin/patched --compare-to ~/local/py35/bin/master -s 'L = [(i,i) 
for i in range(10000)]' -- 'dict(L)'
master: ......................................... 2.06 ms +- 0.11 ms
patched: ......................................... 2.16 ms +- 0.09 ms

Median +- std dev: [master] 2.06 ms +- 0.11 ms -> [patched] 2.16 ms +- 0.09 ms: 
1.05x slower

$ ~/local/py27/bin/master -m perf timeit --rigorous  --python 
~/local/py27/bin/patched --compare-to ~/local/py27/bin/master -s 'L = [(i,i) 
for i in range(10000)]' -- 'dict(L)'
master: ......................................... 1.48 ms +- 0.06 ms
patched: ......................................... 1.57 ms +- 0.09 ms

Median +- std dev: [master] 1.48 ms +- 0.06 ms -> [patched] 1.57 ms +- 0.09 ms: 
1.06x slower

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27945>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to