That is, if you write "C" code in Java, you get about the same performance.
The area where the slow down occurs is where one starts computing with objects in the inner loops.
The extra references in this case slow Java down. I think this is basically due to the extra
overhead of objects, in general. Perhaps the JIT compiler should be able to optimize this out,
but so far, we have not seen it able to do this. In on sense, it is the same slow down one gets
from C++ unless you do a lot of hand optimization. The slow down due to objects is still
not bad and enables the code to still run fast enough in almost all cases we have dealt with.
Dealing with a database, we find that most of the time is spent in the database, not in our java code,
unless we do a lot of massaging of the data coming back from the DBMS.
We have seen substantial improvement of the JIT in the newer releases of Java.
Dave
At 12:37 PM 11/9/2003, Tim Churches wrote:
On Mon, 2003-11-10 at 01:10, David Forslund wrote: > Performance is not an issue, > since Java runs about the same speed as compiled C.
Really? Real-life applications, not just trivial benchmarks loops which the JIT compiler can optimise away? Our experience with Java has been quite different - maybe that was a reflection of the underlying code, rather than Java itself? Certainly I am prepared to believe that Java is fast enough for just about anything, but as fast as compiled C?
--
Tim C
PGP/GnuPG Key 1024D/EAF993D0 available from keyservers everywhere or at http://members.optushome.com.au/tchur/pubkey.asc Key fingerprint = 8C22 BF76 33BA B3B5 1D5B EB37 7891 46A9 EAF9 93D0
