maximum() efficency

Paul McGuire ptmcg at
Mon Mar 27 18:19:26 CEST 2006

"Arne Ludwig" <arne at> wrote in message
news:1143474600.972823.111570 at
> Just for completeness: The functions in Steve's original post named
> maximum calculate the minimum.
> Also, timing-wise, on my machine with a random list of 200000 integers
> Steve's iteration version and Mitja's version are about equal, the
> system built-in is equal or slightly slower, and Paul's version about
> 3-4x slower. If the comparison function is very complex, the mileage
> may vary of course.

Arne -

The version I posted (which is not mine by the way, but I've lost the
original citation) becomes much more competitive when run with psyco.  With
your list of 200,000 integers, I believe it will outpace even the C library

-- Paul

More information about the Python-list mailing list