Skip to content
Back to skills

Rust Performance

ASecurity

Evidence. Use to assess or measure Rust latency, throughput, allocation, memory, or capacity claims, or profile and allocator changes.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 15, 2026
developmentrustgoapiperformance

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 27, 2026

npx -y skills add Dankosik/rust-service-template-rest --skill rust-performance --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rust Performance?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rust Performance
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dankosik-rust-performance/badge)](https://www.skillsdirectory.com/skills/dankosik-rust-performance)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rust-performance
description: "Evidence. Use to assess or measure Rust latency, throughput, allocation, memory, or capacity claims, or profile and allocator changes."
---

# Rust Performance

**Evidence.** Identify the requested deliverable—static audit, measurement, or optimization—and fix the workload, resource bounds, target metric, and comparable baseline before changing code.

**Comparable measurement.** Separate tail latency, throughput, allocation rate, retained memory, peak RSS, startup time, and binary size. Measure release-profile artifacts under matched toolchain, features, inputs, and host conditions while reporting variance; present static code audits as candidate hypotheses and measurement plans until runtime numbers exist.

**Data structures and work.** Match algorithms and representations to actual input distributions, eliminating quadratic work (`Vec::remove(0)` → `into_iter()` or `VecDeque`), repeated map lookups (`Entry` API), redundant buffer growth (`clone_from`, `with_capacity`), unused formatting on cold branches, and intermediate collections (`fmt::from_fn`, `chunks_exact`, `windows`, `chunk_by`); see [hot-path idioms](references/hot-path-idioms.md). Flush and shut down buffered writers (`tokio::io::BufWriter` / `std::io::BufWriter`) explicitly so drops never hide write errors, and delegate hot generic entry points (`impl AsRef<Path>`, `impl Into<T>`) immediately to a non-generic inner function to prevent monomorphization bloat.

**Layout and resource bounds.** Inspect size, enum variant skew, alignment, and indirection on high-volume types while keeping APIs clean until measurements or clear skew justify changes: box rare large `enum` or `Result::Err` variants and large sub-futures (`Box::pin`), and store long-lived immutable collections as `Box<[T]>`, `Box<str>`, or `Arc<str>`. Keep queues, caches, buffers, and background tasks explicitly bounded so foreground latency wins never trade away memory or backpressure control.

**Profiling and build trade-offs.** Pick the probe that isolates the bottleneck—repeated process runs for startup/drain, focused microbenchmarks for pure operations, CPU profiles for compute, and heap profiles for retention—accounting for profiler overhead and `crates/infra-http` post-handler response lifetimes. Weigh allocator, LTO, codegen-unit, panic-strategy (preserving unwind isolation), and build-speed trade-offs via the [build-speed owner](../../../docs/build-speed.md), retaining the simpler correct implementation whenever measurements stay inconclusive.

Files in this skill

  • LICENSE1 KB
  • SKILL.md2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.