On Fri, 27 Jun 2025 01:04:32 GMT, Shaojin Wen <s...@openjdk.org> wrote:

>> In BufferedReader.readLine and other similar scenarios, we need to use 
>> StringBuilder.append(char[]) to build the string.
>> 
>> For these scenarios, we can Unsafe.copyMemory instead of the character copy 
>> of the char-by-char loop to improve the speed.
>> 
>> @RogerRiggs completed the optimization when the encoder is LATIN1 in PR 
>> #24967. This PR continues to complete the optimization when the encoder is 
>> UTF16.
>
> Shaojin Wen has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Update src/java.base/share/classes/java/lang/StringUTF16.java
>   
>   Co-authored-by: Chen Liang <li...@openjdk.org>

I just noticed there is `LibraryCallKit::inline_string_getCharsU` that is for 
byte -> char conversion. I wonder if we can slightly update it for char -> byte 
conversion.

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

PR Comment: https://git.openjdk.org/jdk/pull/24773#issuecomment-3100796762

Reply via email to