Java has always suffered from the perception of being slow, at least when compared to statically compiled languages like C and C++.

How many times have you read this:

   "Java will never be as fast as C or C++"


I strongly disagree, and in fact i would suggest that it is only a matter of time when Java will not only equal the performance of any statically compiled language, but will in fact, surpass them.


Rationale:

The advent of the HotSpot JVM changes everything.

Statically compiled languages are necessarily reliant upon static optimization techniques. The C compilers have taken static optimization to the level of high-art, but they are inherently limited.

In order to optimize an application at compile time, it is necessary to make all kinds of assumptions about the runtime characteristics of that application.

Each application is different, and therefore, has a different runtime profile.

Even if you allow for a very gifted developer who knows how to tweak the compiler flags just so, you will never be able to model the runtime profile of an application with pinpoint accuracy.


HotSpot enables dynamic optimization.

Dynamic optimization opens up whole new horizons of what is possible. The Java compiler does not have to make any assumptions about the runtime characteristics of any given application, and can delegate this to the HotSpot runtime.

HotSpot technology, although still quite new, has already dramatically improved the performance of Java applications. The possibilities open to HotSpot technology for runtime optimization are literally endless.

And a key advantage is that each application can be optimized according to its *exact* runtime profile.
No guess work. This is beyond the scope of static optimization techniques.

HotSpot is fairly new, and no doubt, it is only going to get better.

Thoughts?

Peter