locks: synchronized vs ReentrantLock vs StampedLock companion code
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.
This commit is contained in:
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
# Quick ad hoc JMH run against one benchmark class, printed to the terminal. Example:
|
||||
# ./scripts/run.sh IncrementBenchmark -t 8
|
||||
# ./scripts/run.sh ReadHeavyBenchmark
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
BENCH="${1:?Usage: run.sh <BenchmarkClassName> [extra jmh args]}"
|
||||
shift || true
|
||||
|
||||
JAR=target/benchmarks.jar
|
||||
[ -f "$JAR" ] || { echo "Run 'mvn package' first."; exit 1; }
|
||||
|
||||
java -jar "$JAR" "$BENCH" "$@"
|
||||
Reference in New Issue
Block a user