fastdebug vs optimized?

David Holmes david.holmes at oracle.com
Wed Jan 31 21:46:04 UTC 2018


On 1/02/2018 12:22 AM, coleen.phillimore at oracle.com wrote:
> The idea of optimized was to have the performance of product but the 
> printing and diagnostic options of debug.  We used to use it for 

I'll add though that for a long time there has been a lot of confusion 
around code conditional on DEBUG/ASSERT versus !PRODUCT. I think it 
would be hard to see much consistency on the usage now.

> debugging when we had a lot of race conditions in the vm (a long time 
> ago now there are none J)   We were sensitive to the size of the 
> libjvm.so but since then and since logging, many of the printing 
> functions have been exposed and diagnostic() flags were introduced.
> 
> https://bugs.openjdk.java.net/browse/JDK-8183287

I think we had/have other issues relating to (mis)use of DEBUG, ASSERT, 
PRODUCT conditionals.

David

> It's time to remove it and clean up the assert vs. debug macros, but 
> currently unassigned.
> 
> Thanks,
> Coleen
> 
> On 1/31/18 8:52 AM, Thomas Stüfe wrote:
>> Hi all,
>>
>> Sorry for asking the same question again, but I still struggle to
>> understand the difference between fastdebug and optimized builds. Not the
>> technical details, that is clear (I hope):
>>
>> optimized: optimized build with !ASSERT !PRODUCT
>> fastdebug: optimized build with ASSERT !PRODUCT
>>
>> but what the point is for having two builds with such similarities. 
>> What is
>> the optimized build used for?
>>
>> When should I guard verification code with ASSERT, when with !PRODUCT? As
>> for the latter, it feels weird to use guarantee and then having to 
>> guard it
>> explicitly with !PRODUCT, but that is what I would have to do to get
>> assertions in optimized build while still suppressing them in release
>> builds, yes?
>>
>> I always assumed that the optimized build is supposed to be faster than
>> fastdebug, so, expensive verifications should be better left to 
>> ASSERT? But
>> then, I see quite some coding contradicting this expectation. The coding
>> itself is no real guideline either, I see both ASSERT and !PRODUCT used
>> without recognizing a clear pattern.
>>
>> So, still confused. Can someone enlighten me please :)
>>
>> Thanks & Regards, Thomas
> 


More information about the hotspot-dev mailing list