diff options
Diffstat (limited to 'bench/runbench.sh')
-rwxr-xr-x | bench/runbench.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bench/runbench.sh b/bench/runbench.sh new file mode 100755 index 0000000..77b4e50 --- /dev/null +++ b/bench/runbench.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +OBJ=$1 +shift +PROG=$1 +shift + +if test -z $OBJ; then + echo "This script is supposed to be run from 'make'." + exit 1 +fi + +echo "====> Benchmark results for $PROG" >$PROG-bench +size -t $OBJ | tail -n 1 >>$PROG-bench +wc -c $PROG >>$PROG-bench + +for i in $@; do + echo "== $i" >>$PROG-bench + cat $i >/dev/null + sh -c "time ./$PROG $i" >>$PROG-bench 2>&1 + sh -c "time ./$PROG $i" >>$PROG-bench 2>&1 +done |