how fast is Python?
aleax at aleax.it
Thu Aug 21 08:19:54 CEST 2003
Irmen de Jong wrote:
> Python is fast enough for me, especially 2.3.
> Profile & code slow parts as C extensions.
> Include your own assembly there if so desired.
> Investigate Psyco. There was one example on this
> newsgroup that showed that Python+psyco actually
> outperformed the same program in compiled C.
I think (but will gladly stand corrected if I'm wrong!) that
this is a misinterpretation of some code I posted -- the
C code (crazily) used pow(x,2.0), the Python one (sanely)
x*x -- within a complicated calculation of erf, and that
one malapropism in the C code was what let psyco make
faster code than C did. With C fixed to use x*x -- as any
performance-aware programmer will always code -- the
two ran neck to neck, no advantage to either side.
More information about the Python-list