2019-11-27 15:21:11 +00:00
|
|
|
#!/bin/sh
|
2019-04-10 21:02:21 +00:00
|
|
|
|
2020-09-21 17:52:00 +00:00
|
|
|
if [ "$#" -gt 2 -o "$#" -eq 0 ]; then
|
|
|
|
echo "Usage: driver.sh /path/to/fish [/path/to/other/fish]"
|
|
|
|
exit 1
|
2019-04-10 21:02:21 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
FISH_PATH=$1
|
2020-09-21 17:52:00 +00:00
|
|
|
FISH2_PATH=$2
|
2019-04-10 21:02:21 +00:00
|
|
|
BENCHMARKS_DIR=$(dirname "$0")/benchmarks
|
|
|
|
|
|
|
|
for benchmark in "$BENCHMARKS_DIR"/*; do
|
2019-11-28 01:49:21 +00:00
|
|
|
basename "$benchmark"
|
2020-09-21 17:52:00 +00:00
|
|
|
[ -n "$FISH2_PATH" ] && echo "$FISH_PATH"
|
2019-11-28 01:49:21 +00:00
|
|
|
${FISH_PATH} --print-rusage-self "$benchmark" > /dev/null
|
2020-09-21 17:52:00 +00:00
|
|
|
if [ -n "$FISH2_PATH" ]; then
|
|
|
|
echo "$FISH2_PATH"
|
|
|
|
${FISH2_PATH} --print-rusage-self "$benchmark" > /dev/null
|
|
|
|
fi
|
|
|
|
|
2019-11-27 15:21:11 +00:00
|
|
|
if command -v hyperfine >/dev/null 2>&1; then
|
2020-09-21 17:52:00 +00:00
|
|
|
if [ -n "$FISH2_PATH" ]; then
|
|
|
|
hyperfine "${FISH_PATH} $benchmark > /dev/null" "${FISH2_PATH} $benchmark > /dev/null"
|
|
|
|
else
|
|
|
|
hyperfine "${FISH_PATH} $benchmark > /dev/null"
|
|
|
|
fi
|
2019-11-26 19:10:04 +00:00
|
|
|
fi
|
2019-04-10 21:02:21 +00:00
|
|
|
done
|
|
|
|
|