-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (30 loc) · 1.13 KB
/
Copy pathMakefile
File metadata and controls
39 lines (30 loc) · 1.13 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
GOFLAGS ?=
.PHONY: bench benchmark-report cpu-profile mem-profile race test build clean
## Run all benchmarks with allocation reporting.
bench:
go test -bench=. -benchmem -count=3 ./...
## Run all benchmarks (count=1) and write results to BENCHMARKS.md.
benchmark-report:
bash scripts/benchmark-report.sh
## Capture a CPU profile for FindPaths on the chain benchmarks.
## Output: cpu.prof (view with: go tool pprof cpu.prof)
cpu-profile:
go test -bench=BenchmarkFindPaths -benchmem -cpuprofile=cpu.prof ./pkg/graph/
@echo "Profile written to cpu.prof — run: go tool pprof cpu.prof"
## Capture a heap profile for FindPaths on the chain benchmarks.
## Output: mem.prof (view with: go tool pprof -alloc_objects mem.prof)
mem-profile:
go test -bench=BenchmarkFindPaths -benchmem -memprofile=mem.prof ./pkg/graph/
@echo "Profile written to mem.prof — run: go tool pprof -alloc_objects mem.prof"
## Run the full test suite with the race detector (required CI gate).
race:
go test -race ./...
## Run all tests.
test:
go test ./...
## Build all binaries.
build:
go build ./...
## Remove generated profile files.
clean:
rm -f cpu.prof mem.prof