streaming-huge-json: 1 GiB streaming vs tree vs binding benchmark (Jackson 3.2.4, JDK 25) for the rewritten streaming post
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CifR2BE7PBvRy5hT8TS9oz
This commit is contained in:
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user