mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-04 08:17:24 -05:00
c4d8d53a6d
* Use vendored go-swagger (#8087) * Use vendored go-swagger * vendor go-swagger * revert un wanteed change * remove un-needed GO111MODULE * Update Makefile Co-Authored-By: techknowlogick <matti@mdranta.net> * re-generate swagger file
32 lines
874 B
Bash
32 lines
874 B
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
reference_ref=${1:-master}
|
|
reference_git=${2:-.}
|
|
|
|
if ! `hash benchstat 2>/dev/null`; then
|
|
echo "Installing benchstat"
|
|
go get golang.org/x/perf/cmd/benchstat
|
|
go install golang.org/x/perf/cmd/benchstat
|
|
fi
|
|
|
|
tempdir=`mktemp -d /tmp/go-toml-benchmark-XXXXXX`
|
|
ref_tempdir="${tempdir}/ref"
|
|
ref_benchmark="${ref_tempdir}/benchmark-`echo -n ${reference_ref}|tr -s '/' '-'`.txt"
|
|
local_benchmark="`pwd`/benchmark-local.txt"
|
|
|
|
echo "=== ${reference_ref} (${ref_tempdir})"
|
|
git clone ${reference_git} ${ref_tempdir} >/dev/null 2>/dev/null
|
|
pushd ${ref_tempdir} >/dev/null
|
|
git checkout ${reference_ref} >/dev/null 2>/dev/null
|
|
go test -bench=. -benchmem | tee ${ref_benchmark}
|
|
popd >/dev/null
|
|
|
|
echo ""
|
|
echo "=== local"
|
|
go test -bench=. -benchmem | tee ${local_benchmark}
|
|
|
|
echo ""
|
|
echo "=== diff"
|
|
benchstat -delta-test=none ${ref_benchmark} ${local_benchmark} |