RFR: 8355177: Speed up StringBuilder::append(char[]) via UTF16::compress & Unsafe::copyMemory
Chen Liang
liach at openjdk.org
Mon Apr 21 15:22:41 UTC 2025
On Mon, 21 Apr 2025 07:00:36 GMT, Shaojin Wen <swen at 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 use the intrinsic method StringUTF16.compress and Unsafe.copyMemory instead of the character copy of the char-by-char loop to improve the speed.
This might be helpful combined with #21730.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24773#issuecomment-2818748083
More information about the core-libs-dev
mailing list