-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b10
Using CharacterDataLatin1.instance explicitly in StringLatin1 can be an optimization, especially during startup/warmup, by avoiding the indirection of calling into Character.of(ch). This optimization is already implemented in some places, but we should take advantage of it consistently within java.lang.StringLatin1.
Tests using StringUpperLower microbenchmark show a 1.5-2x speed-up when running with -Xint or -XX:TieredStopAtLevel=1 (C1), with no difference in peak performance when running with out-of-the-box C2 (this is expected after sufficient inlining for the JIT to see which paths unconditionally flow down to CharacterDataLatin1.instance).
Tests using StringUpperLower microbenchmark show a 1.5-2x speed-up when running with -Xint or -XX:TieredStopAtLevel=1 (C1), with no difference in peak performance when running with out-of-the-box C2 (this is expected after sufficient inlining for the JIT to see which paths unconditionally flow down to CharacterDataLatin1.instance).