From 2d4872ba60e41185091357a1cb1aae3bd519854d Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Wed, 10 Apr 2019 14:02:21 -0700 Subject: [PATCH] Add a benchmark driver and a simple benchmark This adds a simple script that drives benchmarks, and a simple sample benchmark. --- benchmarks/benchmarks/seq_echo.fish | 3 +++ benchmarks/driver.sh | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 benchmarks/benchmarks/seq_echo.fish create mode 100755 benchmarks/driver.sh diff --git a/benchmarks/benchmarks/seq_echo.fish b/benchmarks/benchmarks/seq_echo.fish new file mode 100644 index 000000000..56e76da68 --- /dev/null +++ b/benchmarks/benchmarks/seq_echo.fish @@ -0,0 +1,3 @@ +for i in (seq 1000) + echo $i +end diff --git a/benchmarks/driver.sh b/benchmarks/driver.sh new file mode 100755 index 000000000..877cd8fe4 --- /dev/null +++ b/benchmarks/driver.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ "$#" -ne 1 ]; then + echo "Usage: driver.sh /path/to/fish" +fi + +FISH_PATH=$1 +BENCHMARKS_DIR=$(dirname "$0")/benchmarks + +for benchmark in "$BENCHMARKS_DIR"/*; do + echo $(basename "$benchmark") + ${FISH_PATH} --print-rusage-self $benchmark > /dev/null +done +