8245304: Re-examine ThreadLocal usage in java.math.BigDecimal
Alan.Bateman at oracle.com
Wed Aug 12 06:34:20 UTC 2020
On 11/08/2020 18:32, Brian Burkhalter wrote:
> To fix , please consider  which replaces the ThreadLocal “threadLocalStringBuilderHelper” with straightforward use of a StringBuilderHelper instance. The initial capacity of the StringBuilder instance variable of StringBuilderHelper is also doubled from 16 to 32.
> Microbenchmarking was effected primarily using BigDecimal.toEngineeringString(). This method and toString() both invoke layoutChars() which used the ThreadLocal. The toString() method caches its return value but toEngineeringString() does not.
More information about the core-libs-dev