Last active
August 29, 2015 14:14
-
-
Save boutros/1bbe9990a5c43182cbd1 to your computer and use it in GitHub Desktop.
Go benchmark helper scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
num=$1 | |
if [[ -z $num ]] ; then | |
num=1 | |
fi | |
benchmarks=$2 | |
if [[ -z $benchmarks ]] ; then | |
benchmarks="." | |
fi | |
git checkout "HEAD~${num}" > /dev/null 2>&1 | |
go test -run=XXX -benchmem=true -bench="${benchmarks}" > old.txt | |
git checkout master > /dev/null > /dev/null 2>&1 | |
go test -run=XXX -benchmem=true -bench="${benchmarks}" > new.txt | |
benchcmp -mag=true old.txt new.txt | |
rm old.txt new.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
benchmarks=$1 | |
if [[ -z $benchmarks ]] ; then | |
benchmarks="." | |
fi | |
git stash > /dev/null 2>&1 | |
go test -run=XXX -benchmem=true -bench="${benchmarks}" > old.txt | |
git stash pop > /dev/null 2>&1 | |
go test -run=XXX -benchmem=true -bench="${benchmarks}" > new.txt | |
benchcmp -mag=true old.txt new.txt | |
rm old.txt new.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment