Re: Fastest! Counting words (Mirek Fidler.. continues)
"Chris Thomasson" <cristom@comcast.net> writes:
The JVM your using right now was "probably" created with C/C++,
and of course, assembly language.
There actually are several JVMs written in Java.
Some run on another JVM, some are being compiled
to some other language.
So, C/C++ can be used to create a language that performs faster than itself?
Late compiling can take advantage of its knowledge of the
execution environment and processor. C++ usually is compiled
early (before distribution).
A Java optimizer also possibly might do more optimizations,
because he can take more guarantees about the code for granted.
If I understand this
http://shootout.alioth.debian.org/gp4/java.php
right, Java (with the JVM, not JET) is sometimes
("spectral-norm", "sum-file") faster, and often not much
slower (1.1-2.8) than C++.
So, this performance price is not that high, but it buys
developement simplifications by a garbage collector and a
simpler language, more security by Array bound checks,
portability of the class files including net access and a
GUI and a lot of other nice features.
A quotation from the site mentioned above:
?Benchmarking programming languages?
How can we benchmark a programming language?
We can't - we benchmark programming language implementations.
How can we benchmark language implementations?
We can't - we measure particular programs.?