-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
161 lines (140 loc) · 6.62 KB
/
Copy pathTaskfile.yml
File metadata and controls
161 lines (140 loc) · 6.62 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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Taskfile.yml – rust-compile-bench orchestration
# https://taskfile.dev
# Install: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
#
# Usage:
# task setup – clone medium and large reference projects
# task bench – launch the interactive wizard
# task bench:quick – fast single-run smoke test (small project only)
# task bench:compare – compare key optimization profiles on all projects
# task report – regenerate HTML report from latest results
# task clean – remove build artifacts
# task clean:results – remove benchmark results
version: "3"
vars:
BENCH_DIR: "{{.ROOT_DIR}}/bench"
RESULTS_DIR: "{{.ROOT_DIR}}/results"
BENCH_BIN: "{{.BENCH_DIR}}/bench-tool"
tasks:
# ── Build the bench tool ─────────────────────────────────────────────────
build:
desc: "Build the bench CLI tool"
dir: "{{.BENCH_DIR}}"
cmds:
- go build -o bench-tool .
sources:
- "**/*.go"
generates:
- bench-tool
# ── Setup reference projects ─────────────────────────────────────────────
setup:
desc: "Clone and prepare all reference projects (medium + large)"
cmds:
- task: setup:medium
- task: setup:large
setup:medium:
desc: "Clone ripgrep (medium benchmark project)"
cmds:
- bash projects/medium/setup.sh
setup:large:
desc: "Clone rust-analyzer (large benchmark project)"
cmds:
- bash projects/large/setup.sh
# ── Interactive wizard ────────────────────────────────────────────────────
bench:
desc: "Launch the interactive benchmark wizard"
deps: [build]
cmds:
- "{{.BENCH_BIN}} wizard"
# ── Quick smoke test ──────────────────────────────────────────────────────
bench:quick:
desc: "Quick smoke test – 1 run, no warmup, small project only"
deps: [build]
cmds:
- "{{.BENCH_BIN}} run --projects small --profiles baseline --runs 1 --warmup 0 --clean=false --timings=false"
# ── Incremental comparison ────────────────────────────────────────────────
bench:incremental:
desc: "Compare baseline vs incremental build on small project"
deps: [build]
cmds:
- "{{.BENCH_BIN}} run --projects small --profiles baseline,incremental,no-incremental --runs 3 --warmup 1"
# ── Full optimization comparison ──────────────────────────────────────────
bench:compare:
desc: "Compare key optimization profiles (small + medium, if set up)"
deps: [build]
cmds:
- |
PROJECTS="small"
if [ -f "projects/medium/repo/Cargo.toml" ]; then
PROJECTS="small,medium"
fi
{{.BENCH_BIN}} run \
--projects "$PROJECTS" \
--profiles baseline,incremental,lto-thin,codegen-units-max,debug-info-off \
--runs 3 --warmup 1
# ── Nightly comparison (requires nightly toolchain) ───────────────────────
bench:nightly:
desc: "Compare stable vs nightly toolchain (requires: rustup toolchain install nightly)"
deps: [build]
cmds:
- rustup toolchain install nightly --no-self-update
- "{{.BENCH_BIN}} run --projects small --profiles baseline,nightly-baseline,parallel-frontend --runs 3 --warmup 1"
# ── sccache benchmark ────────────────────────────────────────────────────
bench:sccache:
desc: "Benchmark with sccache (requires: cargo install sccache)"
deps: [build]
cmds:
- "{{.BENCH_BIN}} run --projects small --profiles baseline,sccache --runs 3 --warmup 1"
# ── Full suite (all projects, all profiles) ───────────────────────────────
bench:full:
desc: "Run full benchmark suite (all projects + all profiles). WARNING: may take hours."
deps: [build]
cmds:
- "{{.BENCH_BIN}} run --projects all --profiles all --runs 5 --warmup 2"
# ── Generate / view report ────────────────────────────────────────────────
report:
desc: "Regenerate HTML report from the latest results"
deps: [build]
cmds:
- "{{.BENCH_BIN}} report"
- echo "Report is in {{.RESULTS_DIR}}/"
report:open:
desc: "Open the latest HTML report in your browser"
deps: [build]
cmds:
- "{{.BENCH_BIN}} report --open"
# ── List available options ────────────────────────────────────────────────
list:
desc: "List available projects and optimization profiles"
deps: [build]
cmds:
- "{{.BENCH_BIN}} list"
# ── Verify environment ────────────────────────────────────────────────────
check:
desc: "Check that required tools are installed"
cmds:
- bash scripts/check-deps.sh
# ── Build small project alone ─────────────────────────────────────────────
build:small:
desc: "Build the small embedded Rust project directly"
dir: "projects/small"
cmds:
- cargo build
# ── Clean targets ─────────────────────────────────────────────────────────
clean:
desc: "Remove all build artifacts (Rust targets)"
cmds:
- rm -rf projects/small/target
- rm -rf projects/medium/repo/target
- rm -rf projects/large/repo/target
- rm -f "{{.BENCH_BIN}}"
clean:results:
desc: "Remove benchmark results and reports"
cmds:
- rm -rf "{{.RESULTS_DIR}}"
clean:all:
desc: "Remove all artifacts, results, and cloned projects"
deps: [clean, clean:results]
cmds:
- rm -rf projects/medium/repo
- rm -rf projects/large/repo