RFR: 8334328: Reduce object allocation for FloatToDecimal and DoubleToDecimal [v8]
Shaojin Wen
duke at openjdk.org
Mon Jun 17 01:00:29 UTC 2024
On Sun, 16 Jun 2024 23:49:18 GMT, Shaojin Wen <duke at openjdk.org> wrote:
>> src/java.base/share/classes/jdk/internal/math/ToDecimal.java line 169:
>>
>>> 167: }
>>> 168:
>>> 169: /* Using the deprecated constructor enhances performance */
>>
>> Enhances performance over what, `new String(str, 0, index, StandardCharsets.US_ASCII)`? Please specify.
>
> The previous version of the code is like this, which will affect Float.toString and Double.toString. If changed, it is necessary to add the Benchmark of Float.toString and Double.toString, so I don’t want to change this in this PR.
I followed your suggestion and changed it, but Coding uses ISO_8859_1. The performance of ISO_8859_1 is faster than that of the previously abandoned method.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19730#discussion_r1642037877
More information about the core-libs-dev
mailing list