javac, which compiles from a Java source into bytecodes, is almost not optimized. In fact, optimization often leads to slower code performance, making it harder to parse for subsequent optimization.
The only significant difference between the generated code for 1.5 and 1.6 is that when adding 1.6, additional information about the state of the stack is added to make checking easier and faster (Java ME does this as well). This only affects the loading speed of classes.
The real part of optimization is the hotspot compiler, which compiles the bytecode into native code. It is even updated in some versions of updates. On Windows, by default, the JRE only distributes the slow client version of the C1 access point. The C2 server host point is faster (use -server on the java command line), but it starts more slowly and uses more memory.
Also, libraries and tools (including javac) sometimes do optimization work.
I donโt know why you find JDK 6 slower to compile code than JDK 5. Is there any subtle difference in the setup?
source share