Request for review: 6799689

Joshua Bloch jjb at google.com
Thu Feb 26 02:07:03 UTC 2009


OK, then LGTM:)
      Josh

On Wed, Feb 25, 2009 at 6:00 PM, Mandy Chung <Mandy.Chung at sun.com> wrote:

> Thanks. Josh.
>
> I considered the lazy initialization holder class idiom (thanks to your
> Effective Java book and Brian's Java Concurrency in Practice book).  I
> discussed with Joe Darcy about the performance of parseHexString. Since it's
> not a hot method, I decided to go with the simple approach making it a
> synchronized method as a tradeoff of adding one additional class.
>
> Thanks
> Mandy
>
> On 02/25/09 17:50, Joshua Bloch wrote:
>
>> Mandy,
>>
>> Hi! Looks good, but if you care about the performance of parseHexString,
>> you might want to use the "lazy initialization holder class idiom"
>> (Effective Java 2e, Page 283).  I can't promise that you'll be able to
>> measure the difference, or that it will be faster, but I suspect so.
>>
>>    Josh
>>
>> On Wed, Feb 25, 2009 at 5:27 PM, Mandy Chung <Mandy.Chung at sun.com<mailto:
>> Mandy.Chung at sun.com>> wrote:
>>
>>    6799689 Make sun.misc.FloatingDecimal.hexFloatPattern static field
>>    initialized lazily
>>
>>    Webrev:
>>      http://cr.openjdk.java.net/~mchung/6799689/webrev.00/
>>
>>    The Pattern object is not always needed but is currently
>>    instantiated in the static initializer. Lazy initialization of the
>>    hexFloatFattern static field will save the regex classes not to be
>>    loaded until it's needed.
>>
>>    Thanks
>>    Mandy
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20090225/5a390ecf/attachment.html>


More information about the core-libs-dev mailing list