StringBuilder.insert is missing a fast-path for the most frequent case when its argument is String.
Previously they did similar optimization for StringBuilder.append(CharSequence, int, int),
see https://bugs.openjdk.java.net/browse/JDK-8224986
The proponent would like to contribute a trivial patch that brings improvement for the case when SB's content is Latin1 and inserted String is Latin1 as well.
From core-libs-dev:
https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-September/069197.html
Previously they did similar optimization for StringBuilder.append(CharSequence, int, int),
see https://bugs.openjdk.java.net/browse/JDK-8224986
The proponent would like to contribute a trivial patch that brings improvement for the case when SB's content is Latin1 and inserted String is Latin1 as well.
From core-libs-dev:
https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-September/069197.html
- relates to
-
JDK-8257511 JDK-8254082 brings regression to AbstractStringBuilder.insert(int dstOffset, CharSequence s, int start, int end)
- Closed
-
JDK-8224986 (str) optimize StringBuilder.append(CharSequence, int, int) for String arguments
- Resolved
-
JDK-8260927 StringBuilder::insert is incorrect without Compact Strings
- Closed
(1 links to)