Python is darn fast (was: How fast is Python)

Michele Simionato mis6 at pitt.edu
Sun Aug 24 07:29:15 EDT 2003


Your remark made me check which a.out I was timing (I had two
versions,
an optimized one and a standard one). Since I had compiled them one
month
ago, I made some mistake and the numbers I posted refer to the
non-optimized
version, actually :-( Sorry about that, it seemed too good to be true
!
(a factor of 2 in favor of Python!). With the respect to the -O3
optimized version the gain of Python over C is only of 15-20% (Irmen
de Iong
reported 30% on his machine). I am sure that with a newer compiler and
smart switches one can revert the ratio. But the message is still the
same: on this numerical computation, taken from a real life case, C
does not have any significant advantage over Python. Maybe the reason
is
the slow C implementation of exp or some other accident, but still
this
is a quite impressive result.

  Michele




More information about the Python-list mailing list