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.zip

Installs 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.
150 chars✓ has a “when” trigger
Intermediate

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

You give it
Benchmark group or custom Criterion flags
You get back
Benchmark results including median times, throughput, and baseline comparisons

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

  1. If $ARGUMENTS is empty, run:

    cargo bench --package hitls-crypto --all-features
    
  2. If $ARGUMENTS specifies a filter, run:

    cargo bench --package hitls-crypto --all-features -- "$ARGUMENTS"
    
  3. 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

GroupAlgorithms
sha2SHA-256, SHA-384, SHA-512
sha3SHA3-256
sm3SM3
hmacHMAC-SHA256, HMAC-SHA512, HMAC-SM3
aes_gcmAES-128-GCM, AES-256-GCM
aes_cbcAES-128-CBC, AES-256-CBC
chacha20ChaCha20-Poly1305
sm4_cbcSM4-CBC
sm4_gcmSM4-GCM
rsaRSA-2048/3072/4096 keygen + sign/verify
ecdsaECDSA P-256/P-384 sign/verify
ed25519Ed25519 sign/verify
x25519X25519 key exchange
ecdhECDH P-256/P-384
dhFFDHE-2048/3072/4096
sm2SM2 sign/verify
mlkemML-KEM-512/768/1024
mldsaML-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.

SkillInstallsUpdatedSafetyDifficulty
bench (this skill)05moReviewIntermediate
implementing-cards72moReviewAdvanced
rust-async-patterns112moReviewIntermediate
rust-tests-guidelines75moNo flagsBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry