[geeks] Misuse of Java
Joshua D Boyd
jdboyd at cs.millersville.edu
Wed Nov 6 15:18:40 CST 2002
On Wed, Nov 06, 2002 at 02:21:46PM -0500, Greg A. Woods wrote:
> > That's my feeling, as well. Java code doesn't -have- to be slow. It's
> > inherently slower then the equivalent binary object code
>
> From the studies I've read (possibly biased studies -- I wouldn't know
> how to tell the difference :-), Java code is inherently slower than
> pretty much every other interpreted or byte-compiled (or object-
> compiled, though I haven't a clue what the latter could really mean)
> code.
First, a note on object compiling. To my understanding the term usually
denotes a machine code compile, except that external dependencies aren't
resolved, so there are markers throughout the file for where things go
once the dependencies are resolved. So, basically, it is the
intermediate output between gcc and ld. I'm sure your familiar with
this stuff.
Anyway, as to the speed assertion. Either you are leaving out some
qualifiers, or those studies are wrong, I'm pretty sure. Unless the
language is severally flawed, you can say that any language is
inherantly slower than another under any circumstances that I can think
of. You can compare compilers, and for interpretted languages you can
compare run times, but I don't see anything about Java that would imply
that it would be slower than Python.
Now, possible valid states would be that the java byte code is
inefficient. This is a reflection then on the compiler.
You could also assert that JIT code will still never be as fast as
normally compiled code. And certainly that is true in some reguards, if
for no other reason that the time spent compiling the code.
But to say that stuff written in java reguardless of if it is running on
an interpretter, a JIT, or was compiled to raw machine code seems very
flawed to me.
> > but there's a
> > lot to be said for optimizing your application, whether it's
> > interpreted, byte-compiled, or object-compiled.
>
> Yup, but don't forget:
>
> Premature optimization is the root of all evil in programming.
> -- C.A.R. Hoare
I believe he (not Hoare, but the guy you replied to) was refering to
doing things like picking the right algorithm, and I don't think that is
what Hoare was refering to.
> As far as I've ever been able to tell Java has no valid technical reason
> for being -- never really did, and probably never will.
The only thing I can think of is the idea that people might have made
chips for embeded appliances that would run java more quickly than a
regular CPU runs garbage collecting, pointer safe, type safe C code.
> More notable quotes:
>
> Java, the best argument for Smalltalk since C++.
> --unknown
I like that one. Too bad it is unknown.
> Java is the most distressing thing to hit computing since MS-DOS.
> -- Alan Kay
He always has good quotes. I'm on a mailing list that he posts to
regularly, and he always has interesting things to say, even if I don't
agree with him.
--
Joshua D. Boyd
More information about the geeks
mailing list