Executes Criterion benchmarks for specific algorithm groups in Rust projects and reports performance metrics like median time and throughput.
Install
mkdir -p .claude/skills/bench && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14756" && unzip -o skill.zip -d .claude/skills/bench && rm skill.zipInstalls to .claude/skills/bench
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Run Criterion benchmarks for the workspace or a specific group. Use when the user asks to benchmark, measure performance, or compare algorithm speeds.Key capabilities
- →Run all Criterion benchmarks for the workspace
- →Run targeted benchmarks for specific groups (e.g., sha2, aes)
- →Apply custom Criterion flags to benchmarks
- →Report median execution times for benchmarks
- →Calculate throughput (MB/s) for data-processing benchmarks
- →Compare current benchmark results with previous baselines
How it works
This skill executes `cargo bench` commands with specified arguments for a Rust workspace, then parses and reports the performance metrics, including median times and throughput.
Inputs & outputs
When to use bench
- →Measure the performance of cryptographic algorithm implementations.
- →Compare the throughput of different cipher suites like AES or ChaCha20.
- →Analyze execution time regression across code changes using baselines.
- →Run targeted benchmarks for specific groups like sha2 or rsa.
About this skill
Run Criterion benchmarks for openHiTLS-rs.
Usage
/bench— run all benchmarks/bench sha2— run benchmarks matching "sha2"/bench aes -- --sample-size 200— custom Criterion flags
Behavior
-
If
$ARGUMENTSis empty, run:cargo bench --package hitls-crypto --all-features -
If
$ARGUMENTSspecifies a filter, run:cargo bench --package hitls-crypto --all-features -- "$ARGUMENTS" -
After benchmarks complete, report:
- Median times for each benchmark
- Throughput (MB/s) for data-processing benchmarks
- Comparison with previous run (if Criterion baseline exists)
Benchmark Groups
| Group | Algorithms |
|---|---|
| sha2 | SHA-256, SHA-384, SHA-512 |
| sha3 | SHA3-256 |
| sm3 | SM3 |
| hmac | HMAC-SHA256, HMAC-SHA512, HMAC-SM3 |
| aes_gcm | AES-128-GCM, AES-256-GCM |
| aes_cbc | AES-128-CBC, AES-256-CBC |
| chacha20 | ChaCha20-Poly1305 |
| sm4_cbc | SM4-CBC |
| sm4_gcm | SM4-GCM |
| rsa | RSA-2048/3072/4096 keygen + sign/verify |
| ecdsa | ECDSA P-256/P-384 sign/verify |
| ed25519 | Ed25519 sign/verify |
| x25519 | X25519 key exchange |
| ecdh | ECDH P-256/P-384 |
| dh | FFDHE-2048/3072/4096 |
| sm2 | SM2 sign/verify |
| mlkem | ML-KEM-512/768/1024 |
| mldsa | ML-DSA-44/65/87 |
Tips
- Use
--save-baseline <name>to save a baseline for later comparison - Use
--baseline <name>to compare against a saved baseline - Results are stored in
target/criterion/
When not to use it
- →When the user does not want to benchmark performance
- →When the project is not a Rust workspace using Criterion
- →When the task is not about measuring algorithm speeds
Limitations
- →The skill is specific to Criterion benchmarks
- →It is designed for Rust projects
- →Results are stored in `target/criterion/`
How it compares
This skill provides a structured way to run and interpret Criterion benchmarks, including baseline comparisons, simplifying performance analysis compared to manual command execution and data extraction.
Compared to similar skills
bench side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| bench (this skill) | 0 | 5mo | Review | Intermediate |
| implementing-cards | 7 | 2mo | Review | Advanced |
| rust-async-patterns | 11 | 2mo | Review | Intermediate |
| rust-tests-guidelines | 7 | 5mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
implementing-cards
bcollazo
Fill out the implementation of effects of different attacks, abilities, and trainer cards in this Pokemon TCG Pocket engine codebase.
rust-async-patterns
wshobson
Master Rust async programming with Tokio, async traits, error handling, and concurrent patterns. Use when building async Rust applications, implementing concurrent systems, or debugging async code.
rust-tests-guidelines
RediSearch
Guidelines for writing Rust tests.
write-rust-tests
RediSearch
Write Rust tests to verify correctness of Rust code.
check-rust-coverage
RediSearch
Check which Rust lines are not covered by Rust tests.
debug-lldb
regenrek
Capture and analyze thread backtraces with LLDB/GDB to debug hangs, deadlocks, UI freezes, IPC stalls, or high-CPU loops across any language or project. Use when an app becomes unresponsive, switching contexts stalls, or you need thread stacks to locate lock inversion or blocking calls.