CPython vs. Jython/JPython

Mike Coffin mhc at Eng.Sun.COM
Sun Nov 5 22:11:00 CET 2000


Greg Jorgensen wrote:

> There is no way that a Java program can be faster than the equivalent C
> program, on the same computer, if the best practices and idioms of each
> language are followed.

Why?  Speed depends, first, on how much effort is put into the
compiler and run-time system, and, second, on the semantics of the
language---issues like aliasing, garbage collection, run-time
checking, etc.  As far as effort goes, there is a lot going into Java
compilers; more than C compilers I would guess.  Techniques like
dynamic optimization, which are almost never applied to C, are common
for Java.  As far as language semantics goes, it's a mixed bag: Java
has some features that make life harder and some that make life
easier.  Mandated run-time checks make Java compilers a little harder.
The absence of pointer arithmetic and function pointers, and the
aliasing that comes with it, make things a lot easier.  Garbage
collection can cut either way, depending on the program.

So I ask again: why is there "no way"?

-mike



More information about the Python-list mailing list