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.
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.
- links to
-
Review(master) openjdk/jdk/24773