Java is less efficient than Fortran, C, C++ and probably half-a-dozen other languages. When interpreted, Standard Java is about 30-60 times slower than C. When Java is compiled by a just-in-time compiler (jit), it seems to be about 3-6 times slower than C. Java compiler technology is improving rapidly, but how efficient it can get relative to other languages is unclear. Hank Schiffman () believes that Java's native code will be about as fast as C++ in most cases, but hardly ever faster. For the time being, we find Java's just-in-time performance acceptable for prototyping small- to medium-sized problems. However, for large field data examples, we may have to re-implement our application in a better performing language, after we developed it in Java.
Java's performance is improving. New compiler technologies, such as just-in-time compilers, are reducing the performance gap rapidly. System programmers, people who write compilers, improve their Java implementations. Hardware vendors are designing computer chips with Java optimization in mind. Additionally, a group of enthusiastic Java programmers develop tools for high-performance network computing (cite conference 98).
Java offers a standard linking mechanism for native C routines. The mechanism allows a programmer to take advantage of proven, existing C code when ever performance or convenience justifies it. Of course, native subroutines do not have Java's portability, however, a simple mechanism can replace a native subroutine by a Java version if the native subroutine is not available in a certain runtime environment.
But efficiency is not the only criteria to choose a language, or we would all write assembler code. Instead we need to balance the various criteria of a language and ask ourselves: is Java sufficiently efficient?