Add compact-strings module: Compact Strings (JEP 254) measured with JOL on JDK 25, with and without -XX:-CompactStrings, and compact object headers on 25 vs 27

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KqJyCidz3ZgRyHABv2GVJh
This commit is contained in:
2026-10-01 04:23:27 +00:00
co-authored by Claude Sonnet 5.5
parent fadfd05670
commit fc05eed4b5
26 changed files with 943 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
machine: 2 CPUs, Intel(R) Xeon(R) Processor @ 2.10GHz
$ java org.openjdk.jmh.Main -f 2 -wi 3 -w 1 -i 5 -r 1 (25.0.4.1+1-LTS, JMH 1.37)
Benchmark Mode Cnt Score Error Units
StringBench.compareToLastCharDiffers avgt 10 13.515 ± 0.096 ns/op
StringBench.concatTwo avgt 10 75.682 ± 1.184 ns/op
StringBench.equalsSameContent avgt 10 8.563 ± 0.179 ns/op
StringBench.indexOfAbsentString avgt 10 36.571 ± 0.238 ns/op
StringBench.indexOfLastChar avgt 10 2.872 ± 0.092 ns/op
StringBench.toUpper avgt 10 276.137 ± 11.187 ns/op
$ java -XX:-CompactStrings org.openjdk.jmh.Main -f 2 -wi 3 -w 1 -i 5 -r 1 (25.0.4.1+1-LTS, JMH 1.37)
Benchmark Mode Cnt Score Error Units
StringBench.compareToLastCharDiffers avgt 10 16.630 ± 1.244 ns/op
StringBench.concatTwo avgt 10 142.990 ± 2.788 ns/op
StringBench.equalsSameContent avgt 10 14.370 ± 0.857 ns/op
StringBench.indexOfAbsentString avgt 10 71.265 ± 1.693 ns/op
StringBench.indexOfLastChar avgt 10 3.677 ± 0.308 ns/op
StringBench.toUpper avgt 10 558.868 ± 21.992 ns/op