From 5cf0aa2fc0cebbb51227ba0b23e0906088bf3027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 21 Jul 2015 21:01:56 +0200 Subject: Add benchmark for sort and reverse --- bench.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'bench.sh') diff --git a/bench.sh b/bench.sh index 27335287d..367a74403 100755 --- a/bench.sh +++ b/bench.sh @@ -7,21 +7,29 @@ # - Do the same for master # - then compare the two runs with benchcmp -if [ $# -ne 2 ] +benchFilter=".*" + +if (( $# < 2 )); then - echo "USAGE: ./bench.sh " + echo "USAGE: ./bench.sh (and (regexp, optional))" exit 1 fi + +if [ $# -eq 3 ]; then + benchFilter=$3 +fi + + BRANCH=$1 PACKAGE=$2 git checkout $BRANCH -go test -test.run=NONE -bench=".*" -test.benchmem=true ./$PACKAGE > /tmp/bench-$PACKAGE-$BRANCH.txt +go test -test.run=NONE -bench="$benchFilter" -test.benchmem=true ./$PACKAGE > /tmp/bench-$PACKAGE-$BRANCH.txt git checkout master -go test -test.run=NONE -bench=".*" -test.benchmem=true ./$PACKAGE > /tmp/bench-$PACKAGE-master.txt +go test -test.run=NONE -bench="$benchFilter" -test.benchmem=true ./$PACKAGE > /tmp/bench-$PACKAGE-master.txt benchcmp /tmp/bench-$PACKAGE-master.txt /tmp/bench-$PACKAGE-$BRANCH.txt \ No newline at end of file -- cgit v1.2.3