RFR 8017540: Improve multi-threaded contention behavior of BigInteger.toString() radix conversion cache

Brian Burkhalter brian.burkhalter at oracle.com
Tue Jun 25 16:29:19 UTC 2013


Hi Aleksey,

On Jun 25, 2013, at 1:40 AM, Aleksey Shipilev wrote:

> Thanks! Looks good to me.

Cool!

> Rather minor silly nit:
> 
>    cacheLine = Arrays.copyOf(cacheLine, exponent + 1);
>    for (int i = oldSize; i <= exponent; i++) {
> 
> ...is probably more consistent as:
> 
>    cacheLine = Arrays.copyOf(cacheLine, exponent + 1);
>    for (int i = oldSize; i < exponent + 1; i++) {
> 
> This sets up easier subexpression elimination, and also "1" is now
> clearly acts as the "prefetch distance". Although this is the slowpath
> anyway, and does not really matter.

I think we'll just leave it as-is, given that it does not matter.

> -Aleksey.
> (the rural r reviewer)

;-)

Thanks,

Brian


More information about the core-libs-dev mailing list