maximum() efficency

Paul McGuire ptmcg at austin.rr._bogus_.com
Mon Mar 27 18:19:26 CEST 2006


"Arne Ludwig" <arne at citde.net> wrote in message
news:1143474600.972823.111570 at i40g2000cwc.googlegroups.com...
> 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
built-ins.

-- Paul





More information about the Python-list mailing list