Commit 4052c8d
feat(bench): add performance visualization tool across git history
Added comprehensive Python tool to visualize benchmark performance over time:
**New Tool**: scripts/bench-viz.py
- Runs benchmarks across git commit history
- Parses Go benchmark output and extracts metrics
- Generates performance graphs using matplotlib
- Supports parallel execution planning (sequential for now)
- Handles compilation failures gracefully (skips commits)
- Saves results as JSON for reuse
**Features**:
- Individual graphs per benchmark showing all metrics
- Summary graphs grouping benchmarks by category
- CLI with options for commit count, output dir, JSON export
- Automatic date-based x-axis formatting
- Latest value annotations on graphs
**Metrics Visualized**:
- ns/op: Nanoseconds per operation over time
- B/op: Bytes allocated per operation over time
- allocs/op: Allocations per operation over time
**Usage**:
```bash
make bench-viz N=50 # Last 50 commits
./scripts/bench-viz.py --help # Full options
```
**Requirements**: Python 3 + matplotlib
**Documentation Updates**:
- README.md: Added Performance Visualization section with examples
- CONTRIBUTING.md: Added detailed visualization usage guide
- Makefile: Added bench-viz target
- .gitignore: Added out/ and bench_results.json
Graphs are saved to out/ directory and can be embedded in README
to show performance trends across project history.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent c47f8e1 commit 4052c8d
File tree
5 files changed
+542
-1
lines changed- scripts
5 files changed
+542
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| 300 | + | |
300 | 301 | | |
301 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
302 | 331 | | |
303 | 332 | | |
304 | 333 | | |
| |||
355 | 384 | | |
356 | 385 | | |
357 | 386 | | |
| 387 | + | |
358 | 388 | | |
359 | 389 | | |
360 | 390 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
| |||
136 | 142 | | |
137 | 143 | | |
138 | 144 | | |
| 145 | + | |
139 | 146 | | |
140 | 147 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
207 | 229 | | |
208 | 230 | | |
209 | 231 | | |
| 232 | + | |
210 | 233 | | |
211 | 234 | | |
212 | 235 | | |
| |||
0 commit comments