diff options
author | Bjørn Erik Pedersen <[email protected]> | 2015-07-21 21:01:56 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2015-07-21 21:08:20 +0200 |
commit | 5cf0aa2fc0cebbb51227ba0b23e0906088bf3027 (patch) | |
tree | aedf0f24d0719a73771aa84d4d815d3f21f30406 /bench.sh | |
parent | aca0f6044878bdcdcfec63497759e3b8fce49512 (diff) | |
download | hugo-5cf0aa2fc0cebbb51227ba0b23e0906088bf3027.tar.gz hugo-5cf0aa2fc0cebbb51227ba0b23e0906088bf3027.zip |
Add benchmark for sort and reverse
Diffstat (limited to 'bench.sh')
-rwxr-xr-x | bench.sh | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -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 <git-branch> <package-to-bench>" + echo "USAGE: ./bench.sh <git-branch> <package-to-bench> (and <benchmark filter> (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 |