Skip to content

Commit

Permalink
move prepare_$fork.sh invocation to right below hyperfine since test.…
Browse files Browse the repository at this point in the history
…sh also invokes it
  • Loading branch information
hundredwatt committed Jan 12, 2024
1 parent 13e9fb7 commit cdd2117
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions evaluate2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,7 @@ fi
filetimestamp=$(date +"%Y%m%d%H%M%S") # same for all fork.out files from this run
failed=()
for fork in "$@"; do
set -e

# Use prepare script to invoke SDKMAN
if [ -f "./prepare_$fork.sh" ]; then
print_and_execute source "./prepare_$fork.sh"
else
print_and_execute sdk use java $DEFAULT_JAVA_VERSION
fi

set +e # we don't want test.sh or hyperfine failing on 1 fork to exit the script early
set +e # we don't want prepare.sh, test.sh or hyperfine failing on 1 fork to exit the script early

# Run the test suite
print_and_execute $TIMEOUT ./test.sh --quiet $fork
Expand Down Expand Up @@ -174,6 +165,13 @@ for fork in "$@"; do
print_and_execute rm -f measurements.txt
print_and_execute ln -s $MEASUREMENTS_FILE measurements.txt

# Run prepare script
if [ -f "./prepare_$fork.sh" ]; then
print_and_execute source "./prepare_$fork.sh"
else
print_and_execute sdk use java $DEFAULT_JAVA_VERSION
fi

# Use hyperfine to run the benchmark for each fork
HYPERFINE_OPTS="--warmup 0 --runs $RUNS --export-json $fork-$filetimestamp-timing.json --output ./$fork-$filetimestamp.out"

Expand All @@ -195,6 +193,7 @@ for fork in "$@"; do
continue
fi
done
set -e

# Summary
echo -e "${BOLD_WHITE}Summary${RESET}"
Expand Down

0 comments on commit cdd2117

Please sign in to comment.