Re: Help me!! Why java is so popular



raddog58c wrote:
Well written code in a language like C optimally compiled for the
native environment is going to be tough to beat unless you write in
native assembler langauge. I have actually had to write in native
assembler on more than one occasion in real-time systems where
nanoseconds mattered. That's atypical, but these situations do
exist. Anyone suggesting an interpreted language is the way to go in
these environments either has no understanding of the problem space,
or they've got a lot of explaining to do to make that assertion stick.

Others have pointed out that the JIT compiler can beat compile-time optimizations in some cases by virtue of having a different view of the situation. Escape analysis, for example, is a runtime phenomenon.

Because JVM optimizations are global and dynamic, whereas compile-time optimizations are more local and static, the JVM may actually achieve significantly better performance because it follows different analysis paths. This could, and according to what I've read, does achieve far better performance than "C optimally compiled" code.

Myths are supported by misguided intuition. Reality often moves in surprising ways.

- Lew
.