Last active
May 26, 2017 15:45
-
-
Save dr2chase/e2e3a3289bffac72a6ad3592b5ccf96a to your computer and use it in GitHub Desktop.
Script for running a number of benchmarks comparing performance of GOEXPERIMENT=preemptibleloops
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
#!/bin/bash | |
# Run with environment variable "variant" set to some useful string legal in a file name. | |
N=25 | |
if [[ `arch` == "ppc64le" ]] ; then | |
dohttp= | |
else | |
dohttp=1 | |
done | |
./make.bash >& mb0.log | |
cd ../test/bench/go1 | |
go test -c . | |
mv go1.test baseline${variant}.test | |
cd ~/work | |
mkdir -p bench2 | |
cd bench2 | |
mkdir -p baseline${variant} | |
mkdir -p experiment${variant} | |
cd baseline${variant} | |
GOBIN=$PWD go get golang.org/x/benchmarks/... | |
cd ~/work/go/src | |
GOEXPERIMENT=preemptibleloops ./make.bash >& mbx.log | |
cd ../test/bench/go1 | |
go test -c . | |
mv go1.test experiment${variant}.test | |
cd ~/work/bench2/experiment${variant} | |
GOBIN=$PWD go get golang.org/x/benchmarks/... | |
if test $dohttp ; then | |
perflock ./http -benchnum ${N} >& http.log | |
fi | |
perflock ./json -benchnum ${N} >& json.log | |
cd ../baseline${variant} | |
if test $dohttp ; then | |
perflock ./http -benchnum ${N} >& http.log | |
fi | |
perflock ./json -benchnum ${N} >& json.log | |
cd ../ | |
if test $dohttp ; then | |
benchstat {baseline${variant},experiment${variant}}/json.log > json${variant}.cmp | |
fi | |
benchstat {baseline${variant},experiment${variant}}/http.log > http${variant}.cmp | |
head -2 json${variant}.cmp | tail -1 | |
head -2 http${variant}.cmp | tail -1 | |
cd ~/work/go/test/bench/go1 | |
perflock ./baseline${variant}.test -test.bench "Benchmark" -test.count ${N} >& baseline${variant}.log | |
perflock ./experiment${variant}.test -test.bench "Benchmark" -test.count ${N} >& experiment${variant}.log | |
benchstat -geomean baseline${variant}.log experiment${variant}.log >& go1${variant}.cmp | |
cat go1${variant}.cmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment