looking for speed-up ideas
adalke at mindspring.com
Tue Feb 4 08:30:21 CET 2003
Ahh, I should have checked all the posts before responding to another
Ram Bhamidipaty wrote:
> Wow. Your code is a lot nicer than mine! Here is what I got from the
> code without the heapqc support:
> 300klines in 33 seconds.
> With the heapqc module for 300k lines = 34 seconds.
Thanks. Though it takes 2 times longer than your script? Huh?
I can't figure out why. With the heapq code there shouldn't even
be the memory problems I was concerned with.
> Hmm. Something is definately wrong. Your script _should_ be faster.
Ummm, the code you posted as a revision of my code doesn't
have the exit after 300,000 lines, so you might be processing all
2.2M lines. If so, my code is 7/2 times faster.
> Here is what it looks like after I added the heap module:
> There is some kind of bug with the heappop routine not
> returning a tupple. The output I am getting look like each
> element of each tuple is being returned by heappop:
Is this reproducible? Is it in the CVS version slated for Python 2.3?
dalke at dalkescientific.com
More information about the Python-list