| name | performance-analyzer |
| description | Use when writing hot-path code in coordination or scanner engine, before committing changes to scanner-engine modules, when benchmarks show unexpected regressions, or during optimization of gossip-stdx data structures. Static performance analysis. |
Performance Analyzer
Analyze performance-critical code in the gossip-rs workspace (coordination, scanner engine, data structures).
When to Use
- After writing hot-path code (coordination, scanning, decoding, validation)
- Before committing changes to
crates/scanner-engine/src/engine/ modules
- When benchmark results show unexpected regressions
- During optimization work on data structures in
crates/gossip-stdx/src/
Analysis Checklist
Memory & Allocation
CPU & Cache
Async & Concurrency
Rust-Specific
Project-Specific Patterns
This codebase uses these performance patterns:
NONE_U32 = u32::MAX as sentinel (avoid Option overhead)
#[inline(always)] on hot-path functions
debug_assert! for invariant checks (zero cost in release)
- Const generics (
G) for compile-time granularity selection
Output Format
## Performance Analysis: [file/function]
### Findings
| Severity | Issue | Location | Impact |
|----------|-------|----------|--------|
| HIGH | Allocation in hot loop | line:XX | ~Xns per call |
| MEDIUM | Missing inline hint | line:XX | Potential call overhead |
### Recommendations
1. **[Issue]**: [Specific fix with code example]
```rust
// Before
// After
Validation
Run these benchmarks to verify:
cargo bench --bench <relevant_bench>
## Related Skills
- `/bench-compare` - Before/after measurement
- `/asm-forge` - ASM-guided optimization
- `/perf-regression` - Full regression workflow