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

Claes Redestad redestad at openjdk.org
Mon Oct 16 08:41:58 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

Might as well use `StringConcatFactory.makeConcatWithConstants` as per my suggestion above, which bootstraps a concatenation expression that should be about as optimal as can be here? While there's some ceremony to it it's all public API, and we can simplify to `return "" + ...` when/if we manage to set up the build system to compile parts of java.base without `-XDstringConcat=inline`

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

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


More information about the core-libs-dev mailing list