Index of maximum element in list

bearophileHUGS at bearophileHUGS at
Sun Jan 27 11:49:25 CET 2008

> That version is easy to translate to other languages and you can
> probably find that Psyco makes it much faster still.

That operation is quite common, so it deserves a bit more work:

(I can show you the D/C code if you want it. The C code is just for
testing, while the D code is usable).

The final sum: the Psyco version is almost 40 times faster than the
Python version, and just 2.8 times slower than the D version, and 3.4
times slower than a C version (that doesn't use too many pointer
tricks). I think this is good enough.


More information about the Python-list mailing list