File: bench.sh

package info (click to toggle)
golang-github-gorgonia-tensor 0.9.24-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,696 kB
  • sloc: sh: 18; asm: 18; makefile: 8
file content (23 lines) | stat: -rwxr-xr-x 525 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

old=$1;
new=$2;

git checkout $old
# https://stackoverflow.com/a/2111099
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
echo "Benchmarking $branch (old)"
go test -run=$^ -bench=. > ${branch}.bench
for i in {1..10}
	 do
	 go test -run=$^ -bench=. >> ${branch}.bench
	 done

git checkout $new
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
echo "Benchmarking $branch (new)"
go test -run=$^ -bench=. > ${branch}.bench
for i in {1..10}
	 do
	 go test -run=$^ -bench=. >> ${branch}.bench
	 done