From bef92baa48a9844ba1284a9c5412fff72684abbf Mon Sep 17 00:00:00 2001 From: bep Date: Thu, 14 May 2015 23:18:00 +0200 Subject: Add convenience script to run benchmarks --- .gitignore | 1 + bench.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 bench.sh diff --git a/.gitignore b/.gitignore index 41162a757..73a0539cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ hugo docs/public* +/.idea hugo.exe *.test *.prof 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 " + 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 -- cgit v1.2.3