File: Makefile

package info (click to toggle)
golang-golang-x-exp 0.0~git20231006.7918f67-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, trixie
  • size: 6,492 kB
  • sloc: ansic: 1,900; objc: 276; sh: 272; asm: 48; makefile: 27
file content (25 lines) | stat: -rw-r--r-- 780 bytes parent folder | download | duplicates (5)
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
# Run and compare benchmarks.
# This requires a version of benchstat that supports
# the -ignore flag. The flag was added on or before 13 January 2023,
# so a compatible version can be obtained by running
#    go install golang.org/x/perf/cmd/benchstat@latest

count = 10

default: compare-zap compare-zerolog

compare-%: %_benchmarks/out.bench slog.bench
	benchstat -ignore pkg $^

slog.bench: *.go ../*.go ../../go.mod
	go test -run NONE -bench . -count $(count) > $@

slog-nopc.bench: *.go ../*.go ../../go.mod
	go test -nopc -run NONE -bench . -count $(count) > $@

%_benchmarks/out.bench: %_benchmarks/*.go %_benchmarks/go.mod
	go test -C $*_benchmarks  -bench . -count $(count) > $@

# Don't delete the out.bench files after a comparison.
.PRECIOUS: %_benchmarks/out.bench