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:
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# Builds and runs StringBench on JDK 25 with the default and with -XX:-CompactStrings; writes ../output/30-jmh.txt (about 6 minutes).
|
||||
# JDK25=/path ./run-jmh.sh (run ./fetch.sh once first)
|
||||
set -uo pipefail
|
||||
unset JAVA_TOOL_OPTIONS
|
||||
HERE="$(cd "$(dirname "$0")" && pwd)"; cd "$HERE"
|
||||
JDK25="${JDK25:-/opt/jdks/jdk-25.0.4.1+1}"
|
||||
CP="$(ls lib/*.jar | tr '\n' ':')"; B="$(mktemp -d)"; trap 'rm -rf "$B"' EXIT
|
||||
"$JDK25/bin/javac" -cp "$CP" -processorpath "$CP" -d "$B" src/bench/StringBench.java 2>&1 | grep -v '^Note:'
|
||||
{
|
||||
echo "machine: $(nproc) CPUs, $(grep -m1 'model name' /proc/cpuinfo | sed 's/.*: //')"
|
||||
for fl in "" "-XX:-CompactStrings"; do
|
||||
echo; echo "\$ java $fl org.openjdk.jmh.Main -f 2 -wi 3 -w 1 -i 5 -r 1 ($("$JDK25/bin/java" -version 2>&1 | sed -n 2p | sed 's/.*(build \(.*\))/\1/'), JMH 1.37)"
|
||||
"$JDK25/bin/java" -cp "$B:$CP" org.openjdk.jmh.Main -f 2 -wi 3 -w 1 -i 5 -r 1 -jvmArgs "$fl" 2>&1 | sed -n '/^Benchmark /,$p'
|
||||
done
|
||||
} > "$HERE/../output/30-jmh.txt"
|
||||
cat "$HERE/../output/30-jmh.txt"
|
||||
Reference in New Issue
Block a user