mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-08 01:14:39 +00:00
4c3cd4c9e3
Because it's literally ten times faster: benchmark old ns/op new ns/op delta BenchmarkMatch-8 13842 1200 -91.33% BenchmarkMatchCached-8 139 147 +5.76% benchmark old allocs new allocs delta BenchmarkMatch-8 0 0 +0.00% BenchmarkMatchCached-8 0 0 +0.00% benchmark old bytes new bytes delta BenchmarkMatch-8 12 0 -100.00% BenchmarkMatchCached-8 0 0 +0.00%
27 lines
552 B
Bash
27 lines
552 B
Bash
#! /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"
|