mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-23 15:03:05 +00:00
Add convenience script to run benchmarks
This commit is contained in:
parent
be1a566203
commit
bef92baa48
2 changed files with 28 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
|||
hugo
|
||||
docs/public*
|
||||
/.idea
|
||||
hugo.exe
|
||||
*.test
|
||||
*.prof
|
||||
|
|
27
bench.sh
Executable file
27
bench.sh
Executable file
|
@ -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 <git-branch> <package-to-bench>"
|
||||
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
|
Loading…
Reference in a new issue