[issue27945] Various segfaults with dict
INADA Naoki
report at bugs.python.org
Thu Nov 17 08:13:33 EST 2016
INADA Naoki added the comment:
I modified the patch to avoid incref&decref when pair is not list, because tuple is common for such case.
But I can't get back original performance.
(python 2.7 is modified version of patch)
inada-n at test1:~/work/bench$ ~/local/py27/bin/master -m perf timeit --rigorous --python ~/local/py27/bin/python2.7 --compare-to ~/local/py27/bin/master -s 'L = [(i,i) for i in range(10000)]' -- 'dict(L)'
master: ......................................... 1.47 ms +- 0.06 ms
python2.7: ......................................... 1.55 ms +- 0.06 ms
Median +- std dev: [master] 1.47 ms +- 0.06 ms -> [python2.7] 1.55 ms +- 0.06 ms: 1.05x slower
inada-n at test1:~/work/bench$ ~/local/py27/bin/master -m perf timeit --rigorous --python ~/local/py27/bin/python2.7 --compare-to ~/local/py27/bin/patched -s 'L = [(i,i) for i in range(10000)]' -- 'dict(L)'
patched: ......................................... 1.56 ms +- 0.08 ms
python2.7: ......................................... 1.55 ms +- 0.09 ms
Median +- std dev: [patched] 1.56 ms +- 0.08 ms -> [python2.7] 1.55 ms +- 0.09 ms: 1.01x faster
Not significant!
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27945>
_______________________________________
More information about the Python-bugs-list
mailing list