Skip to content

Commit 6da8135

Browse files
Krastanovclaude
andcommitted
Update CLAUDE.md with benchmark documentation
- Add benchmark folder to project structure - Add benchmarks section with local run instructions - Document when to add benchmarks and file structure guidelines - Add workflow step to remind about benchmarks for new functionality Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 20b4de2 commit 6da8135

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

CLAUDE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Tools for Pauli Based Computation (PBC), a modality of quantum computation.
1010
- `src/plotting.jl` - Plotting function stubs (scaffolding for extensions)
1111
- `ext/PBCCompilerMakieExt/` - Makie extension for circuit visualization
1212
- `test/` - Test suite using TestItemRunner.jl
13+
- `benchmark/` - Performance benchmarks using BenchmarkTools.jl
1314

1415
## Dependencies
1516

@@ -94,6 +95,7 @@ circuitplot_axis(fig[1,1], circuit) # Create complete figure panel
9495
3. Commit often at each change
9596
4. Update CLAUDE.md with new functionality
9697
5. Run tests before creating PRs
98+
6. Add benchmarks for new performance-critical functionality
9799

98100
### Docstring Guidelines
99101
- Docstrings are for **users**, not developers
@@ -106,6 +108,26 @@ circuitplot_axis(fig[1,1], circuit) # Create complete figure panel
106108
julia -tauto --project -e 'using Pkg; Pkg.test("PBCCompiler")'
107109
```
108110

111+
### Benchmarks
112+
Benchmarks are managed with BenchmarkTools.jl and run in CI via AirspeedVelocity.jl.
113+
114+
Run benchmarks locally:
115+
```bash
116+
julia -tauto --project=benchmark -e 'include("benchmark/benchmarks.jl"); run(SUITE)'
117+
```
118+
119+
**When to add benchmarks:**
120+
- New compilation passes or transformations
121+
- New traversal operations
122+
- Any function that processes circuits at scale
123+
- Performance-critical code paths
124+
125+
**Benchmark file structure:**
126+
- Add new benchmarks to `benchmark/benchmarks.jl`
127+
- Use `evals=1` for functions that modify state in-place
128+
- Use `setup=` to create fresh data for each evaluation
129+
- Group related benchmarks using `BenchmarkGroup`
130+
109131
### Julia invocation
110132
Always use the `-tauto` flag when launching Julia to utilize all available threads, which drastically speeds up compilation times:
111133
```bash

0 commit comments

Comments
 (0)