why python is slower than java?

Kendall Clark kendall at monkeyfist.com
Sat Nov 6 18:10:19 CET 2004


On Fri, Nov 05, 2004 at 05:58:09AM +0000, Maurice LING wrote:
> This may be a dumb thing to ask, but besides the penalty for dynamic 
> typing, is there any other real reasons that Python is slower than Java?

I favor a different kind of explanation than the ones usually offered
here. While the degree to which Python is "slower than Java" will
depend in large part on what you're trying to do with both of them,
it's also the case that Java leads Python by probably $1 billion
dollars, if not more, in JIT compiler R&D.

The main reason Java is "faster" is because it's been backed by Sun
and IBM, for use in enterprise applications, on some of the biggest
hardware available, and they've put massive R&D effort (i.e., money)
into making it faster.

I suspect if MS had chosen Python instead of C#, and then spent a few
billion and 5 to 10 years of R&D effort, people would be asking why
Perl is so much slower than Python.

Common Lisp is fast because it's had similar R&D effort, spread out
over 40 years or so, going back to the first Lisps. Same goes for
Smalltalk. Java is fast because Sun & IBM and others decided it had to
be. Python is slower because the Python community is incomparably
smaller, less well-heeled, and mostly doesn't care too much about
performance.

There are *technical* reasons for all of this, but I think those
reasons exist largely because of non-technical, social reasons.

My two cents. :>

Best,
Kendall Clark
-- 
Sometimes it's appropriate, even patriotic, to be ashamed
of your country. -- James Howard Kunstler



More information about the Python-list mailing list