From efe6fb3c3b5ab725c20e532bf60e2aedc8b90913 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 26 Nov 2019 11:10:04 -0800 Subject: [PATCH] Use hyperfine in the benchmark driver if available --- benchmarks/driver.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/benchmarks/driver.sh b/benchmarks/driver.sh index 877cd8fe4..f2e0e45a6 100755 --- a/benchmarks/driver.sh +++ b/benchmarks/driver.sh @@ -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