performance-and-benchmarking-standards

Establishes Rust benchmarking and profiling standards using Criterion.rs and cargo-flamegraph for CI/CD regression detection.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive framework for ensuring code runs efficiently, identifying performance bottlenecks, and preventing regressions through rigorous benchmarking and profiling.

Core Features & Use Cases

  • Benchmarking: Utilize Criterion.rs for latency, throughput, and allocation tracking.
  • Profiling: Employ flamegraph, perf, and Instruments for CPU and memory analysis.
  • Optimization: Implement zero-copy patterns and buffer reuse for memory efficiency.
  • Use Case: A developer needs to ensure a new feature doesn't degrade the application's response time. They use this Skill to set up benchmarks, profile the code, and integrate checks into the CI pipeline to catch any performance regressions.

Quick Start

Use the performance-and-benchmarking-standards skill to set up a new benchmark for the data processing module.

Frequently Asked Questions about performance-and-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?

To detect performance regressions in a Rust CI/CD pipeline, integrate Criterion benchmarks to automatically track latency and throughput changes across builds. This catches degradation automatically during continuous integration.

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

The best way to profile Rust code for CPU and memory bottlenecks is using cargo-flamegraph, perf, and Instruments to generate flamegraphs for detailed performance analysis and allocation tracking.

How do I set up benchmarks with Criterion.rs to measure throughput?

Set up Criterion.rs benchmarks to measure throughput by configuring benchmarking suites that track latency, throughput, and memory allocations, enabling precise detection of performance regressions in Rust applications.

Does implementing zero-copy patterns in Rust improve memory efficiency?

Implementing zero-copy patterns and buffer reuse in Rust improves memory efficiency by minimizing unnecessary allocations. Combined with allocation tracking, this optimization significantly reduces memory bottlenecks.

When should I use cargo-flamegraph instead of perf for profiling?

Use cargo-flamegraph to visualize Rust call stacks as an interactive flamegraph, whereas perf provides lower-level CPU and memory analysis. Both identify bottlenecks but offer different granularity for profiling.