16 lines
796 B
Bash
16 lines
796 B
Bash
#!/usr/bin/env bash
|
|
# Regenerates every file in output/. Needs JDK 25 and Maven. The first Maven run must be online.
|
|
# 01-11 are written by JUnit tests that assert the same facts (deterministic).
|
|
# 12-14 are MEASUREMENTS of StackOverflowError depth: they depend on the machine, the JVM build
|
|
# and the -Xss setting, and the depth even varies between attempts inside one JVM.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
mkdir -p output
|
|
mvn -B -q test
|
|
mvn -B -q compile
|
|
run() { java "$@" -cp target/classes com.ankurm.interviewlab.bintree.DeepRecursionDemo 2>&1 | grep -v '^Picked up JAVA_TOOL_OPTIONS' ; }
|
|
run > output/12-deep-recursion-default-stack.txt
|
|
run -Xss512k > output/13-deep-recursion-xss512k.txt
|
|
run -Xss4m > output/14-deep-recursion-xss4m.txt
|
|
echo "done:"; ls -1 output
|