any impact on performance from javac's debug option ?

Tom Rodriguez Thomas.Rodriguez at Sun.COM
Mon Aug 4 13:09:41 PDT 2008

Unfortunately yes.  There's a bug filed about it though I don't  
remember the id offhand.  The compilers should use sizing metrics  
which take asserts into account, along with having some bytecode  
specific metrics, but we haven't done any work on this yet.  Hiding  
the existence of asserts is slighly tricky since it requires at least  
som control flow analysis.


On Aug 4, 2008, at 12:53 PM, Charles Oliver Nutter wrote:

> 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