diff options
author | bep <bjorn.erik.pedersen@gmail.com> | 2015-05-14 23:18:00 +0200 |
---|---|---|
committer | bep <bjorn.erik.pedersen@gmail.com> | 2015-05-14 23:17:45 +0200 |
commit | bef92baa48a9844ba1284a9c5412fff72684abbf (patch) | |
tree | d70781958bea3149c1fb809c649a0b610daf58f7 /bench.sh | |
parent | be1a566203292bff51298afd4c8c46bd6df7cc0a (diff) | |
download | hugo-bef92baa48a9844ba1284a9c5412fff72684abbf.tar.gz hugo-bef92baa48a9844ba1284a9c5412fff72684abbf.zip |
Add convenience script to run benchmarks
Diffstat (limited to 'bench.sh')
-rwxr-xr-x | bench.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/bench.sh b/bench.sh new file mode 100755 index 000000000..27335287d --- /dev/null +++ b/bench.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + + +# Convenience script to +# - For a given branch +# - Run benchmark tests for a given package +# - Do the same for master +# - then compare the two runs with benchcmp + +if [ $# -ne 2 ] + then + echo "USAGE: ./bench.sh <git-branch> <package-to-bench>" + exit 1 +fi + + +BRANCH=$1 +PACKAGE=$2 + +git checkout $BRANCH +go test -test.run=NONE -bench=".*" -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 + + +benchcmp /tmp/bench-$PACKAGE-master.txt /tmp/bench-$PACKAGE-$BRANCH.txt
\ No newline at end of file |