[issue4207] Remove backwards compatibility in _heapq for performance

Kristján Valur Jónsson report at bugs.python.org
Sun Oct 26 14:49:29 CET 2008


Kristján Valur Jónsson <kristjan at ccpgames.com> added the comment:

I am sorry for not doing my research about the age of the compatibility 
fix.
However, modifying the test slightly to work with tuples of
(random.random(), random.random())
shows a performance increase from:

heapify 0.366187741738
pushpop 0.541365033824
replace 2.69348946584
push and pop 3.12545093022

to:

heapify 0.186918030085
pushpop 0.405662172148
replace 1.46039447751
push and pop 1.75253663524

This does look like a large price to pay for this compatibility layer.

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


More information about the Python-bugs-list mailing list