We liberally use Arrays.copyOfRange in String constructors etc, but while investigating another performance issue (JDK-8295496) it was made apparent that the redundant range check and length clamping done by this method has a measurable cost.
Specializing for cases where from is zero and to might be length helps String constructors by a sizable amount, reducing checks but also enabling improved matching of arraycopy stubs.
Specializing for cases where from is zero and to might be length helps String constructors by a sizable amount, reducing checks but also enabling improved matching of arraycopy stubs.
- relates to
-
JDK-8295496 Poor performance in String(byte[]) constructors for ASCII/Latin-1 inputs
-
- Open
-
-
JDK-8304651 Footprint increase 2-3% with Jetty in b10 with all GCs
-
- Open
-