Performance & Benchmarking Standards

Enforce Criterion.rs benchmarking and profiling standards for Rust performance.

836|66|Updated Feb 3, 2025
One-click install
npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill performance-benchmarking-standards-kreuzberg-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Performance & Benchmarking Standards
Source: https://github.com/kreuzberg-dev/html-to-markdown/tree/main/.remote-cache/kreuzberg-shared-rules/.ai-rulez/skills/performance-and-benchmarking-standards
Command: npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill performance-benchmarking-standards-kreuzberg-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill establishes rigorous standards and practices for measuring and improving code performance, ensuring efficient and reliable software.

Core Features & Use Cases

  • Benchmarking: Utilizes Criterion.rs for detailed performance analysis (latency, throughput, memory).
  • Profiling: Integrates tools like cargo-flamegraph and perf for identifying performance bottlenecks.
  • Optimization Techniques: Guides on zero-copy patterns, buffer reuse, and efficient string handling.
  • CI Integration: Ensures performance regressions are detected and flagged automatically in the CI/CD pipeline.
  • Use Case: A developer can use this skill to set up automated performance tests that run on every code change, preventing performance degradations before they reach production.

Quick Start

Implement Criterion.rs benchmarks in the benches/ directory for performance-critical Rust code.

Frequently Asked Questions about Performance & Benchmarking Standards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect performance regressions in a Rust CI/CD pipeline?

Set up Criterion.rs benchmarks in your Rust CI/CD pipeline to measure latency and throughput automatically, detecting performance regressions before they reach production.

What is the best way to profile Rust code for bottlenecks?

The best way to profile Rust code for bottlenecks is using cargo-flamegraph and perf, which visually map execution time to specific functions and identify exact performance bottlenecks.

How do I set up Criterion.rs benchmarks for a Rust project?

To set up Criterion.rs benchmarks, implement your performance tests in the `benches/` directory of your Rust project, enabling detailed analysis of latency, throughput, and memory usage for critical code paths.

What optimization patterns improve memory efficiency in Rust?

Optimization patterns that improve memory efficiency in Rust include zero-copy patterns, buffer reuse, and efficient string handling, which minimize allocations and reduce overhead during execution.

When should I run automated performance tests in a Rust project?

You should run automated performance tests on every code change in your Rust project, ensuring that performance regressions are caught early in the CI/CD pipeline rather than after reaching production.