Java Reference
In-Depth Information
and observing what it does: this is the second reason why JIT compilers wait to compile sec-
tions of code.
QUICK SUMMARY
1. Java is designed to take advantage of the platform independence of scripting lan-
guages and the native performance of compiled languages.
2. A Java class file is compiled into an intermediate language (Java bytecodes) that
is then further compiled into assembly language by the JVM.
3. Compilation of the bytecodes into assembly language performs a number of op-
timizations that greatly improve performance.
Basic Tunings: Client or Server (or Both)
The JIT compiler comes in two flavors, and the choice of which to use is often the only com-
piler tuning that needs to be done when running an application. In fact, choosing your com-
piler is something that must be considered even before Java is installed, since different Java
binaries contain different compilers. That will get sorted out in just a bit; first, let's figure out
which one should be used in which circumstances.
The two compilers are known as client and server . These names come from the
command-line argument used to select the compiler (e.g., either -client or -server ). JVM
developers (and even some tools) often refer to the compilers by the names C1 (compiler 1,
client compiler) and C2 (compiler 2, server compiler). The names imply that the choice
between them should be influenced by the hardware on which the program is running, but
that's not really true: especially today, some 15 years after the terms were first utilized, and
your “client” laptop has four to eight CPUs and 8 GB of memory (which is more processing
power than a midrange server had when Java was first developed).
Search WWH ::




Custom Search