N x Q model, source splittability, boxing, ordered operations, common-pool starvation, and parallel-stream correctness bugs. Captured output in output/. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6hCTuFrQT8xKmmMrF
24 lines
1.2 KiB
Bash
Executable File
24 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Regenerates every file in output/. About 25 minutes on 2 vCPUs, almost all of it JMH.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
mkdir -p output
|
|
mvn -q -B package -DskipTests
|
|
JMH="java -jar target/benchmarks.jar -f 1 -wi 3 -w 1s -i 5 -r 1s"
|
|
|
|
echo "availableProcessors = $(java -cp target/classes com.ankurm.parallelstreams.CpuInfo 2>/dev/null)" > output/00-environment.txt
|
|
java -version 2>> output/00-environment.txt || true
|
|
|
|
java -Djava.util.concurrent.ForkJoinPool.common.parallelism=3 -cp target/classes \
|
|
com.ankurm.parallelstreams.CorrectnessBugsDemo > output/01-correctness-bugs.txt
|
|
java -Djava.util.concurrent.ForkJoinPool.common.parallelism=3 -cp target/classes \
|
|
com.ankurm.parallelstreams.CommonPoolStarvationDemo > output/02-common-pool-starvation.txt
|
|
$JMH NqBenchmark > output/03-nq-benchmark.txt
|
|
$JMH SourceBenchmark > output/04-source-benchmark.txt
|
|
$JMH BoxingBenchmark -prof gc > output/05-boxing-benchmark.txt
|
|
$JMH OrderedOpsBenchmark > output/06-ordered-ops-benchmark.txt
|
|
mvn -B test | grep -E 'Tests run|BUILD|ParallelStreamsTest' > output/07-tests.txt
|
|
|
|
# Strip JVM environment noise (proxy banner, Unsafe deprecation warnings) from the committed files.
|
|
sed -i '/^Picked up JAVA_TOOL_OPTIONS/d;/^WARNING:/d' output/*.txt
|