File: bench

package info (click to toggle)
dnss 0.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 368 kB
  • sloc: sh: 237; makefile: 6
file content (26 lines) | stat: -rwxr-xr-x 644 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
24
25
26
#!/bin/bash
#
# This is a small utility that helps run and diff benchmarks, using
# "go test -bench" and "benchstat".
#
# It's only used for development and not meant to be portable, or have a
# stable interface.
#
# Examples:
#   # Run the benchmarks, recording the output IFF the tree is not dirty.
#   ./tests/bench
#
#   # Diff between two recorded commits.
#   benchstat BASE=.bench-history/... LAST=.bench-history/last

set -e

cd "$(git rev-parse --show-toplevel)"

BDIR=".bench-history"
mkdir -p $BDIR

FNAME="$BDIR/$(date "+%Y-%m-%d-%H:%M")-$(git describe --always --dirty)"

echo file: $FNAME
go test -bench=. ./... "$@" | tee $FNAME