Re: Java performance
borophyll@gmail.com wrote:
I am just interested in the latest stats on Java performance. A lot
of the literature appears to be out of date in this respect. Is it
true that Java performance is close to that of native compiled code?
I suppose it could be said that Java *is* natively compiled (at run
time), but there will surely be performance penalties due to bytecode
translation, at least at program startup.
In the extreme short-term (i.e., in the first few minutes), Java is
going to have noticeable impact: one comparison metric gives it about
1.2-1.3 times native code (after taking startup into account). Over
longer periods of time--especially if the server VM is used--Java
performance is near, at, or better than native compiled code.
Finally, I have read that garbage collection is generally more
efficient than manual memory management. Is this true, and if so,
why?
In most cases, yes. Part of the problem is that manual management is
manual and people are not quite as good at profiling memory as computers
are. In addition, garbage collection can more easily benefit from
parallel execution, a bonus in the coming days of multi-core CPUs and
other parallelization techniques.
--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth