-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b18
The pattern coder() == other.coder() is used in several places in String, motivated by the fact each methods will evaluate the static final COMPACT_STRINGS and thus allow code paths to be removed by JIT when necessary.
The high number of method calls can be a problem during startup/warmup, however, and it might be possible to tune this up without affecting or even improving peak performance in some cases.
Ideas to explore:
- add sameCoder(String) http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-December/057191.html
- early length check http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-December/057181.html
- replace inner branch Arrays.equals http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-December/057183.html
Combining the first two ideas appear peak performance neutral (for both -XX:-/+CompactStrings) in a couple of simple tests, but twice as fast during startup. Will test a few other ideas and experiment with better micros.
The high number of method calls can be a problem during startup/warmup, however, and it might be possible to tune this up without affecting or even improving peak performance in some cases.
Ideas to explore:
- add sameCoder(String) http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-December/057191.html
- early length check http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-December/057181.html
- replace inner branch Arrays.equals http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-December/057183.html
Combining the first two ideas appear peak performance neutral (for both -XX:-/+CompactStrings) in a couple of simple tests, but twice as fast during startup. Will test a few other ideas and experiment with better micros.