INADA Naoki added the comment:

When no change happens:

$ ./py-patched -m perf timeit --compare-to `pwd`/py-default -s 'from 
collections import Ordedict; od = odict.fromkeys("abcdefghijklmnopqrstuvwxyz")' 
-- 'od.move_to_end("a", 0)'                                                     
                     
py-default: ..................... 90.6 ns +- 1.0 ns
py-patched: ..................... 107 ns +- 1 ns

Mean +- std dev: [py-default] 90.6 ns +- 1.0 ns -> [py-patched] 107 ns +- 1 ns: 
1.18x slower (+18%)

When change happens:

$ ./py-patched -m perf timeit --compare-to `pwd`/py-default -s 'from 
collections import OrderedDict as odict; od = 
odict.fromkeys("abcdefghijklmnopqrstuvwxyz")' -- 'od.move_to_end("y", 0); 
od.move_to_end("z", 0)'
py-default: ..................... 233 ns +- 4 ns
py-patched: ..................... 304 ns +- 2 ns

Mean +- std dev: [py-default] 233 ns +- 4 ns -> [py-patched] 304 ns +- 2 ns: 
1.30x slower (+30%)

----------

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

Reply via email to