.codex/skills/perf-regression/SKILL.md
Performance regression testing workflow for hot path changes
npx skillsauth add ahrav/gossip-rs perf-regressionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
IMPORTANT: Follow this workflow before merging any feature that touches hot paths in the gossip-rs workspace.
Invoke this skill when modifying:
crates/gossip-stdx/src/ (InlineVec, RingBuffer, ByteSlab)crates/gossip-coordination/src/crates/gossip-contracts/src/crates/scanner-engine/src/crates/gossip-scanner-runtime/src/crates/scanner-scheduler/src/crates/scanner-git/src/git stash push -m "feature-name"
RUSTFLAGS="-C target-cpu=native" cargo build --release
Save baselines for all relevant benchmark suites:
# Run all workspace benchmarks
cargo bench --workspace -- --save-baseline before
# Or target specific crates:
cargo bench -p gossip-stdx -- --save-baseline before
cargo bench -p gossip-contracts -- --save-baseline before
cargo bench -p gossip-coordination -- --save-baseline before
git stash pop
RUSTFLAGS="-C target-cpu=native" cargo build --release
# Compare against baseline (all workspace benchmarks)
cargo bench --workspace -- --baseline before
# Or target specific crates:
cargo bench -p gossip-stdx -- --baseline before
cargo bench -p gossip-contracts -- --baseline before
cargo bench -p gossip-coordination -- --baseline before
Look for these patterns in Criterion output:
Performance has improved — Optimization successfulPerformance has regressed — Changes hurt performanceNo change in performance — Within noise threshold| Crate | Bench File | Measures |
|-------|-----------|----------|
| gossip-contracts | identity.rs | Identity type construction and derivation |
| gossip-coordination | coordination.rs | Shard coordination operations |
| gossip-coordination | sim.rs | Simulation harness benchmarks |
| gossip-stdx | byte_slab.rs | Byte slab pool allocation |
| gossip-stdx | inline_vec.rs | InlineVec operations |
| gossip-stdx | ring_buffer.rs | RingBuffer throughput |
| Regression Level | Action | |------------------|--------| | None (<2%) | Ship as-is | | Minor (2-5%) | Document reason, acceptable for correctness | | Moderate (5-10%) | Requires compelling justification | | Major (>10%) | Must investigate and optimize |
Include in PR description:
Report results as:
## Performance Regression Results
### Criterion Benchmarks
| Crate | Benchmark | Baseline | After | Delta |
|-------|-----------|----------|-------|-------|
| gossip-stdx | inline_vec/push | X ns | Y ns | +/-Z% |
| gossip-stdx | ring_buffer/enqueue | X ns | Y ns | +/-Z% |
| gossip-stdx | byte_slab/alloc | X ns | Y ns | +/-Z% |
| gossip-contracts | identity/derive | X ns | Y ns | +/-Z% |
| gossip-coordination | coordination/acquire | X ns | Y ns | +/-Z% |
### Verdict
[None/Minor/Moderate/Major] regression - [justification if >2%]
/bench-compare — Quick before/after benchmark comparison/asm-forge — Assembly-guided optimization for hot functions/linux-perf-profile — Hardware counter analysis for deeper investigation/performance-analyzer — Static hotspot analysis for this project's patternsdevelopment
Deep first-principles code explanation that builds real understanding through phased walkthroughs with diagrams. Covers algorithms, data structures, memory layout, concurrency patterns, and performance tricks — especially for systems code in Rust. Use whenever the user asks to explain, walk through, break down, deep dive into, or understand code. Trigger on "how does this work", "what's happening here", "teach me about this", "why is it done this way", or when the user references a file with @ and wants to understand it. Proactively use when examining code involving lock-free algorithms, atomics/CAS, memory ordering,
development
Use when creating implementation-ready beads tasks that need testing strategy, optimal implementation approach, and documentation requirements baked in — composes /create-task with parallel enrichment agents that analyze the codebase and produce concrete test specifications, algorithm/data-structure guidance, and doc quality standards so implementing agents don't need to re-research
development
--- name: autoresearch description: Autonomous Goal-directed Iteration. Apply Karpathy's autoresearch principles to ANY task. Loops autonomously — modify, verify, keep/discard, repeat. Supports bounded iteration via Iterations: N inline config. version: 1.9.11 --- # Claude Autoresearch — Autonomous Goal-directed Iteration Inspired by [Karpathy's autoresearch](https://github.com/karpathy/autoresearch). Applies constraint-driven autonomous iteration to ANY work — not just ML research. **Core id
development
Use when implementing a new feature and assessing coverage gaps, during periodic test hygiene, when test suites feel bloated, or before merging code that changes coordination or hot paths. Two-phase assess-then-improve testing pipeline.