RFR: 8315585: Optimization for decimal to string [v6]

Claes Redestad redestad at openjdk.org
Mon Oct 16 12:27:54 UTC 2023


On Fri, 13 Oct 2023 17:01:11 GMT, Shaojin Wen <duke at openjdk.org> wrote:

>> I submitted PR #15555 before, and there were too many changes. I split it into multiple PRs with small changes. This one is one of them.
>> 
>> this PR removed the duplicate code for getChars in BigDecimal#StringBuilderHelper, i also make performance faster.
>> Please review and don't hesitate to critique my approach and patch.
>
> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   use % calculate lowInt

I've seen this happen, too. Possibly a compiler bug or maybe an issue with the benchmark: Can you try changing the benchmark to produce a random distribution of values for the two digits, and not hardcode all values to end with `".55"`? This might be causing the JIT to speculate a bit too optimistically...

-------------

PR Comment: https://git.openjdk.org/jdk/pull/16006#issuecomment-1764362489


More information about the core-libs-dev mailing list