Sun javac The compiler has a concept for debugging information that can (optionally) be omitted from the compiled class.
Check the documentation and check the -g flags:
-g Generate all debugging information, including local variables. By default, only line number and source file information is generated. -g:none Do not generate any debugging information. -g:{keyword list} Generate only some kinds of debugging information, specified by a comma separated list of keywords. Valid keywords are: source Source file debugging information lines Line number debugging information vars Local variable debugging information
They may not be as extensive as the bytecode optimization that .NET compilers can do (which I am not familiar with, sorry), but I think that they exist in theory for performance reasons (smaller class files, etc.) .
In practice, I strongly suspect that they will not make much difference to runtime performance on modern hardware + JVMs, but they are.
Cowan
source share