any impact on performance from javac's debug option ?

Charles Oliver Nutter charles.nutter at
Mon Aug 4 12:53:03 PDT 2008

On a similar note, what about asserts? Do they add to bytecode size and 
thereby affect inlining decisions?

Tom Rodriguez wrote:
> I looked into this a while back and the only code generation difference 
> with -g is that locals which are declared as final constants actually 
> get code emitted for them.  Without -g things like "final int i = 4;" 
> act pretty much like defines so that every use of i is simply replaced 
> with 4.  With -g a local is actually allocated and initialized though 
> otherwise the code is the same.  In general this won't have any effect 
> on the code either c1 or c2 emit but it does slightly increase the size 
> of the bytecodes.  Since both c1 and c2 use bytecode size as a metric 
> for inlining decisions it could cause a method not to be inlined.  C1 is 
> probably more sensitive to this since it has no profile feedback in it's 
> inlining decisions.  That's the only difference I'm aware of.
> tom
> On Aug 2, 2008, at 8:31 AM, Ulf Zibis wrote:
>> Hi,
>> does javac's debug option have any impact on the performance of the 
>> code ?
>> I can't see any difference after some loops, but is there a difference
>> principally ?
>> Regards,
>> Ulf

More information about the hotspot-dev mailing list