Use hyperfine in the benchmark driver if available

This commit is contained in:
ridiculousfish 2019-11-26 11:10:04 -08:00
parent 662fb3f3d1
commit efe6fb3c3b

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
if [ "$#" -ne 1 ]; then
echo "Usage: driver.sh /path/to/fish"
@ -10,5 +10,8 @@ BENCHMARKS_DIR=$(dirname "$0")/benchmarks
for benchmark in "$BENCHMARKS_DIR"/*; do
echo $(basename "$benchmark")
${FISH_PATH} --print-rusage-self $benchmark > /dev/null
if hash hyperfine 2>/dev/null; then
hyperfine "${FISH_PATH} $benchmark > /dev/null"
fi
done