WHY is python slow?

Niklas Frykholm r2d2 at mao.acc.umu.se
Fri Jun 8 02:28:41 EDT 2001


>Although it is generally accepted that Python is slower than
>Java/Perl/Ruby, a layman like me would be curious to know why
>exactly this is so. In other words, why is the implementation
>of a language like Ruby (which is on par with Python in terms
>of 'everything is an object', strong reflection, dynamic
>nature).

The difference in speed between Perl/Python/Ruby is so small
and so application-dependent that saying that one language is
"faster" carries very little meaning. And choosing which language
to develop in based on its "perceived speed" is plain foolery.

Most applications only need to be "fast enough". If it isn't
fast enough in Python, the chance is very slim that it will
be fast enough in Perl or Ruby. Do not choose the fastest
language --- choose the one you want to program in.

Java is a slightly different horse. Some programs, for example
those heavy on function calls or array manipulation can be
much faster because of the static typing. But usually, an
extension module, such as PyNumeric can take care of that.

(I'll program in Java, but only if you pay me :)

// Niklas



More information about the Python-list mailing list