fastdebug vs optimized?
Thomas Stüfe
thomas.stuefe at gmail.com
Wed Jan 31 14:43:21 UTC 2018
On Wed, Jan 31, 2018 at 3:22 PM, <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 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
>
> It's time to remove it and clean up the assert vs. debug macros, but
> currently unassigned.
>
> Thanks,
> Coleen
>
>
Thanks, Coleen!
So, for me that means probably not to bother with !PRODUCT and just use
ASSERT on verification code, right?
..Thomas
>
> 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