JMH throughput sweep (1-64 threads), 9:1 read-heavy @Group benchmark, tryLock(timeout) deadlock-avoidance demo, and a JDK21-vs-JDK25 JEP 491 virtual-thread-pinning comparison. Also promotes LICENSE to repo root now that a second module exists.
39 lines
1.7 KiB
Bash
Executable File
39 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Regenerates every file in output/ using the same commands used to produce the ones
|
|
# committed here. Requires JDK 25 on PATH/JAVA_HOME for the main build, plus a JDK 21
|
|
# install for output/01 (see the comment above that command below).
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
mvn -q package
|
|
|
|
echo "--- 02: pinning demo (JDK 25, post-JEP-491) ---"
|
|
java -cp target/classes -Djdk.tracePinnedThreads=full com.ankurm.locks.VirtualThreadPinningDemo \
|
|
> output/02-pinning-jdk25-post-jep491.txt 2>&1 || true
|
|
|
|
echo "--- 03: tryLock timeout deadlock avoidance ---"
|
|
java -cp target/classes com.ankurm.locks.TryLockTimeoutDemo \
|
|
> output/03-trylock-timeout-deadlock-avoidance.txt 2>&1
|
|
|
|
echo "--- 04: IncrementBenchmark thread-count sweep (takes a few minutes) ---"
|
|
{
|
|
echo '$ java -jar target/benchmarks.jar IncrementBenchmark -t <N> -rf text'
|
|
for t in 1 2 4 8 16 32 64; do
|
|
echo "=== threads=$t ==="
|
|
java -jar target/benchmarks.jar "IncrementBenchmark" -t "$t" -rf text -rff /tmp/jmh-increment-$t.txt
|
|
cat "/tmp/jmh-increment-$t.txt"
|
|
echo ""
|
|
done
|
|
} > output/04-increment-benchmark-sweep.txt
|
|
|
|
echo "--- 05: ReadHeavyBenchmark (9:1 read:write via @Group) ---"
|
|
java -jar target/benchmarks.jar "ReadHeavyBenchmark" -rf text -rff output/05-read-heavy-benchmark.txt
|
|
|
|
echo "--- 06: correctness tests ---"
|
|
mvn -q test
|
|
cp target/surefire-reports/com.ankurm.locks.CounterCorrectnessTest.txt output/06-counter-correctness.txt
|
|
|
|
echo "--- 01: pinning demo on JDK 21 (pre-JEP-491) - needs a separate JDK 21 install ---"
|
|
echo " javac --release 21 -d /tmp/pinning-jdk21-classes src/main/java/com/ankurm/locks/VirtualThreadPinningDemo.java"
|
|
echo " java -cp /tmp/pinning-jdk21-classes -Djdk.tracePinnedThreads=full com.ankurm.locks.VirtualThreadPinningDemo"
|