~poldi1405/go-yenc

ref: 335947ccad0799b6f62dd9e561e205737515e44b go-yenc/testdata/benchmarks/benchmark.sh -rwxr-xr-x 543 bytes
335947cc — Moritz Poldrack updated benchmarks 1 year, 8 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/env bash

runs=100

rm -rf results.d
mkdir results.d

for i in $(seq $runs); do
	echo -ne " running benchmark: $i/$runs         \r"
	go test -bench=. | head -n -2 | tail -n +4 > results.d/$i
done

echo " running benchmark: completed"

awk 'NR==FNR{a[$1]=$3+" ";next;} {a[$1]=($1 in a)?a[$1] $3 " ":$3 " "}END{for(x in a)print x, a[x]}' results.d/* | sed 's/$/ /' > results.d/joined

vim results.d/joined

awk 'BEGIN{FS=" "}{ n=0; sum=0; for(i=1;i<NF;++i) { if( $i ) { ++n; sum += $i; } } print $1 ": " sum/n; }' results.d/joined | sort