#!/usr/bin/env bash # Builds the module, runs the small demos (captured to output/), generates the 1 GiB file # (NOT committed: target/ is git-ignored) and runs the memory ladder. Needs a JDK 25 on PATH. # ./scripts/run-all.sh full run, ~5-10 minutes # ./scripts/run-all.sh --quick small demos only, no 1 GiB file set -eu cd "$(dirname "$0")/.." mvn -B -q compile mvn -B -q dependency:build-classpath -Dmdep.outputFile=target/cp.txt CP="target/classes:$(cat target/cp.txt)" for c in NestedTrap TruncatedFile ReadLimits; do # grep -v strips the sandbox's injected "Picked up JAVA_TOOL_OPTIONS" notice (not program output) java -cp "$CP" com.ankurm.jackson3.streaminghuge.$c 2>&1 | grep -v '^Picked up' > output/$c.txt echo "wrote output/$c.txt" done [ "${1:-}" = "--quick" ] && exit 0 [ -f target/huge.json ] || java -Xmx64m -cp "$CP" com.ankurm.jackson3.streaminghuge.GenerateHugeJson 2>&1 \ | grep -v '^Picked up' | tee output/GenerateHugeJson.txt # the naive hybrid: shows the trailing-token failure on a small file java -Xmx64m -cp "$CP" com.ankurm.jackson3.streaminghuge.GenerateHugeJson target/small.json 5000000 2>&1 | grep -v '^Picked up' > /dev/null java -Xmx512m -cp "$CP" com.ankurm.jackson3.streaminghuge.Scan hybrid-naive target/small.json 2>&1 \ | grep -v '^Picked up' | head -4 > output/HybridNaive.txt || true rm -f target/small.json scripts/bench.sh target/huge.json