javac: debug vs. optimized classes?

M

Markus Dehmann

The external library I am using is compiled with debug info, and it's
pretty slow.

Could I expect it to be much faster if it were compiled with
-debug:none? What about javac -O? Does that still exist?

Are there speed comparisons between debug and optimized classes?

Thanks!
Markus
 
T

Thomas Fritsch

Markus Dehmann said:
The external library I am using is compiled with debug info, and it's
pretty slow.

Could I expect it to be much faster if it were compiled with -debug:none?
No, it will have exactly the same execution speed. The only things you can
expect are
(1) a smaller file size (by a few percent), and hence slightly shorter
download times
(2) less error information (due to missing line numbers in exception stack
traces)
 
R

Roedy Green

Are there speed comparisons between debug and optimized classes?

There is an fairly way to find out and on your particular program
where it matters most:

use the -g:none option on Javac and execute with the public JRE
java.exe to try without debug.

use the -g option on javac and execute with the private JRE java.exe
in the JDK to try with debug.
 
R

Roedy Green

No, it will have exactly the same execution speed.

Actually it would be slightly slower since some of your ram is chewed
up with line number offset tables and the like.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top