一键导入
bench-compare
Run Criterion benchmarks with baseline comparison for performance optimization work
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run Criterion benchmarks with baseline comparison for performance optimization work
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Write-then-verify documentation pipeline. Use when a user asks to improve comments or docs, explain algorithms or design choices, write or upgrade docstrings, or raise documentation quality for a codebase (especially Rust crates). Writes docs, then automatically verifies every claim against code reality using a fresh agent to eliminate confirmation bias.
Use when you have code review findings, PR comments, or review reports that need to be systematically addressed — especially when there are multiple findings across different files and severities
Use when creating any beads task — auto-researches the codebase, links related tasks, and produces a rich self-contained description from a structured template. Accepts minimal intent and outputs a complete task ready for agent implementation.
Use when you have code review findings, PR comments, or review reports that need to be systematically addressed — especially when there are multiple findings across different files and severities
Use when a task needs an implementation plan that is iteratively created and stress-tested through review-and-revise cycles before implementation begins — catches blind spots, incorrect codebase assumptions, unnecessary complexity, and performance pitfalls while changes are still cheap
Use when a markdown plan file exists and needs validation before implementation — catches design flaws, logic holes, footguns, unnecessary complexity, and performance concerns while changes are still cheap
| name | bench-compare |
| description | Run Criterion benchmarks with baseline comparison for performance optimization work |
Compare benchmark results against a baseline to measure optimization impact.
Invoke with optional benchmark filter:
bench-compare - Run all benchmarksbench-compare scan - Run only scan-related benchmarksbench-compare throughput - Run throughput benchmarksBefore making changes, save current benchmark results:
cargo bench --bench <name> -- --save-baseline before
Or for all benchmarks:
cargo bench -- --save-baseline before
Make the optimization changes to the codebase.
Run benchmarks against the saved baseline:
cargo bench --bench <name> -- --baseline before
Look for these patterns in Criterion output:
Performance has improved - Optimization successfulPerformance has regressed - Changes hurt performanceNo change in performance - Within noise thresholdProvide a summary table:
| Benchmark | Before | After | Change |
|---|---|---|---|
| name | X ns | Y ns | -Z% |
The project has these benchmark files in benches/:
scan.rs - Core scanning performancescanner_throughput.rs - End-to-end throughputvectorscan_overhead.rs - Vectorscan integration overheadrule_isolation.rs - Per-rule cost isolationhotspots.rs - Known hot path benchmarks (requires bench feature)validator.rs - Validation step benchmarks (requires bench feature)ring_buffer, fixed_set, fixed_vec, timing_wheel, etc.--bench <name> to run specific benchmarks for faster iterationhotspots and validator benches require: cargo bench --features benchmemory_bandwidth.rs