[Python-Dev] heapq, min and max

Kristján Valur Jónsson kristjan at ccpgames.com
Wed Oct 22 16:50:23 CEST 2008


Ok.  And sorry, I missed your part about heapq now having a c implementation.
This is indeed good, I was misled by the presence of heapq.py.

However, our own heapify() implementation is some 10% faster on a 10000 element
list of floats than the _heapq.heapify() version.
I'll investigate the difference.

K

> -----Original Message-----
> From: python-dev-bounces+kristjan=ccpgames.com at python.org
> [mailto:python-dev-bounces+kristjan=ccpgames.com at python.org] On Behalf
> Of Antoine Pitrou
> Sent: Wednesday, October 22, 2008 14:41
> To: python-dev at python.org
> Subject: Re: [Python-Dev] heapq, min and max
>
> Kristján Valur Jónsson <kristjan <at> ccpgames.com> writes:
> >
> > 0.39713821814841893   (old)
> > 0.35184029691278162   (hakced, for special list treatment)
> >
> > So, there is a 12% performance boost to be had by specializing for
> lists.
> > How about it?
>
> It depends on the added code complexity. In any case, you should open
> an entry
> on the tracker and post your patch there.
>
> Regards
>
> Antoine.
>
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-
> dev/kristjan%40ccpgames.com


More information about the Python-Dev mailing list