Is there a performance difference between Javac debug on and off?

In any language, debugging information is meta information. It by its nature increases the size of the object files, thus increasing load time. During execution outside a debugger, this information is actually completely ignored. As outlined (although not clearly) in the JVM spec the debug information is stored outside the bytecode stream. This means that at execution time there is no difference in the class file. If you want to be sure though, try it out :-).

Ps. Often for debugging there is value in turning off optimization. That does have a performance impact.

Leave a Comment