OpenParable
Skip to content
← Back to skills

Run Rust Benchmarks

Testing & Quality
run-rust-benchmarks

Run Rust Benchmarks is an Agent Skill for testing & quality published in the RediSearch/RediSearch repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Run Rust benchmarks and compare performance with the C implementation. Use this when you work on migrating C code to Rust and want to ensure performance is not regressed.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/RediSearch/RediSearch/blob/HEAD/.skills/run-rust-benchmarks/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/run-rust-benchmarks, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Rust Benchmarks Skill

Run Rust benchmarks and compare performance with the C implementation.

Arguments

  • <crate>: Run the given benchmark crate (e.g., /run-rust-benchmarks rqe_iterators_bencher)
  • <crate> <bench>: Run specific bench in a benchmark crate (e.g., /run-rust-benchmarks rqe_iterators_bencher "Iterator - InvertedIndex - Numeric - Read Dense")

Arguments provided: $ARGUMENTS

Instructions

  1. Check the arguments provided above:
    • If a crate name is provided, run benchmarks for that crate:
      cargo bench --manifest-path src/redisearch_rs/Cargo.toml -p <crate_name>
      
    • If both crate and bench name are provided, run the specific bench:
      cargo bench --manifest-path src/redisearch_rs/Cargo.toml -p <crate_name> <bench_name>
      
  2. Run benchmarks only once. If the output is too large or truncated, extract the timing data from the saved output file rather than re-running the benchmarks.
  3. Once the benchmarks are complete, generate a summary comparing the average run times between the Rust and C implementations.
  4. Ask the user: "Would you like a copyable markdown version for your PR description?" If yes, re-emit the summary table inside a fenced ```markdown code block so it can be pasted directly.

Common Benchmark Commands

# Bench given crate
cargo bench --manifest-path src/redisearch_rs/Cargo.toml -p rqe_iterators_bencher
cargo bench --manifest-path src/redisearch_rs/Cargo.toml -p inverted_index_bencher

# Run a specific benchmark
cargo bench --manifest-path src/redisearch_rs/Cargo.toml -p rqe_iterators_bencher "Iterator - InvertedIndex - Numeric - Read Dense"