-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (55 loc) · 1.71 KB
/
Makefile
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
focus ='worker|distributor'
ignore = 'strings|fmt'
gol:
go build
./gameoflife
# Add -run /[NAME]
# eg: -run /16x16x2-0
# to run a specific test
test:
go test
# Use -benchtime [TIME][UNIT]
# eg: -benchtime 60s
# to force the benchmark to run for the specified amount of time
# Use -bench /[NAME]
# eg: -bench /16x16x2
# to run a specific benchmark
# bench will run all tests before benchmarking - they must all pass
bench:
go test -bench .
compare:
./comparison/compare.sh
trace:
go test -run=Test/trace -trace trace.out
go tool trace trace.out
# Requires graphviz to work correctly
cpuprofile:
go test -bench /512x512x8 -cpuprofile cpu.prof
go tool pprof -pdf -nodefraction=0 -unit=ms -focus=$(focus) -ignore=$(ignore) cpu.prof
# Interactive mode - Useful commands:
# top10
# list worker
# list distributor
cpuprofile-i:
go test -bench /512x512x8 -cpuprofile cpu.prof
go tool pprof -nodefraction=0 -unit=ms -focus=$(focus) -ignore=$(ignore) cpu.prof
# Requires graphviz to work correctly
memprofile:
go test -bench /512x512x8 -memprofile mem.prof --memprofilerate=1
go tool pprof -pdf -alloc_space -nodefraction=0 -unit=B -focus=$(focus) -ignore=$(ignore) mem.prof
# Interactive mode - Useful commands:
# top10
# list worker
# list distributor
memprofile-i:
go test -bench /512x512x8 -memprofile mem.prof --memprofilerate=1
go tool pprof -alloc_space -nodefraction=0 -unit=B -focus=$(focus) -ignore=$(ignore) mem.prof
perf:
sudo perf stat -d go test -bench /512x512x2
sudo perf stat -d go test -bench /512x512x4
sudo perf stat -d go test -bench /512x512x8
time:
time go test -bench /512x512x2
time go test -bench /512x512x4
time go test -bench /512x512x8
.PHONY: gameoflife compare baseline baseline.test