dnscontrol/vendor/github.com/gobwas/glob/bench.sh
Tom Limoncelli 5ee3b206f5 govendor: Update 4 golang.org/x (#523)
* govendor: Update github.com/golang/protobuf

* govendor: Update github.com/gobwas/glob github.com/google/go-github

* govendor: Update 3 github.com/robertkrimen/otto

* govendor: Update 4 golang.org/x

golang.org/x/crypto
golang.org/x/net
golang.org/x/sys
golang.org/x/text
golang.org/x/time
golang.org/x/crypto
2019-07-08 09:50:47 -04:00

26 lines
552 B
Bash
Executable file

#! /bin/bash
bench() {
filename="/tmp/$1-$2.bench"
if test -e "${filename}";
then
echo "Already exists ${filename}"
else
backup=`git rev-parse --abbrev-ref HEAD`
git checkout $1
echo -n "Creating ${filename}... "
go test ./... -run=NONE -bench=$2 > "${filename}" -benchmem
echo "OK"
git checkout ${backup}
sleep 5
fi
}
to=$1
current=`git rev-parse --abbrev-ref HEAD`
bench ${to} $2
bench ${current} $2
benchcmp $3 "/tmp/${to}-$2.bench" "/tmp/${current}-$2.bench"