RFR: 8333893: Optimization for StringBuilder append boolean & null [v15]
Shaojin Wen
duke at openjdk.org
Tue Jul 23 22:22:34 UTC 2024
On Tue, 23 Jul 2024 13:48:57 GMT, Chen Liang <liach at openjdk.org> wrote:
>> explicit array stores has the overhead of boundary checking. If putCharsAt of StringLatin1 is not implemented based on Unsafe, the performance will be worse than StringUTF16.
>>
>> Of course, this is a common problem. StringUTF16.putChar is equivalent to Unsafe.putChar, without boundary checking. I found in many test scenarios that the UTF16 version performs better than the StringLatin1 version.
>>
>> We may need to change some StringLatin1 related implementations to use Unsafe, otherwise users will turn off COMPACT_STRINGS to improve performance.
>
> Thank you for telling what the blocking issue is here. Does C2 not merge the bound checks when it does the merge stores? Interesting, and I think a fix from their side should be the way to go.
MergeStore does not work when using StringUTF16.putChar, waiting for improvements from @eme64
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19626#discussion_r1688786926
More information about the hotspot-compiler-dev
mailing list