javac: debug vs. optimized classes?

Discussion in 'Java' started by Markus Dehmann, Oct 4, 2005.

  1. 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
     
    Markus Dehmann, Oct 4, 2005
    #1
    1. Advertising

  2. "Markus Dehmann" <> schrieb:
    > 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)

    > What about javac -O? Does that still exist?
    >
    > Are there speed comparisons between debug and optimized classes?

    --
    "TFritsch$t-online:de".replace(':','.').replace('$','@')
     
    Thomas Fritsch, Oct 4, 2005
    #2
    1. Advertising

  3. Markus Dehmann

    Roedy Green Guest

    On Mon, 03 Oct 2005 22:03:57 -0400, Markus Dehmann
    <> wrote or quoted :

    >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.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
     
    Roedy Green, Oct 4, 2005
    #3
  4. Markus Dehmann

    Roedy Green Guest

    On Tue, 4 Oct 2005 04:27:40 +0200, "Thomas Fritsch"
    <> wrote or quoted :

    >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.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
     
    Roedy Green, Oct 4, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tulip

    area optimized port mapping

    tulip, Nov 3, 2004, in forum: VHDL
    Replies:
    1
    Views:
    488
    Nicolas Matringe
    Nov 3, 2004
  2. Markus Dehmann
    Replies:
    11
    Views:
    760
    Pete Becker
    Mar 20, 2005
  3. Replies:
    4
    Views:
    4,974
    Greg R. Broderick
    Jul 28, 2006
  4. Shawn
    Replies:
    9
    Views:
    3,059
  5. Markus Henschel
    Replies:
    8
    Views:
    662
    benben
    Feb 14, 2006
Loading...

Share This Page