rust-performance
Evidence. Use to assess or measure Rust latency, throughput, allocation, memory, or capacity claims, or profile and allocator changes.
Install
npx skills add https://github.com/Dankosik/cargo-modernize/tree/main/.agents/skills/rust-performance
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install dankosik-cargo-modernize@llmmart
git clone https://github.com/Dankosik/cargo-modernize.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole dankosik/cargo-modernize collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
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 wall-clock scan time, per-file 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, removing copies, intermediate collections, or repeated passes where measured gains outweigh added complexity and preserving streaming, ordering, and failure semantics. Prioritize startup or hot-path clones according to the metric that matters.
Layout and resource bounds. Inspect size, enum variant skew, alignment, and indirection on high-volume types while keeping APIs clean until measurements justify layout changes. Keep queues, caches, buffers, and background tasks bounded so foreground latency wins never trade away memory or backpressure control.
Profiling and build trade-offs. Pick the probe that isolates the bottleneck—hyperfine runs of cargo modernize over large real workspaces for end-to-end time, focused microbenchmarks for pure matcher or renderer operations, CPU profiles for parsing and detection, and heap profiles for retained syntax trees and caches—accounting for profiler overhead and separating cold from warm filesystem caches. Weigh allocator, LTO, codegen-unit, and build-speed trade-offs while keeping panic = "unwind" (required for per-file panic isolation), retaining the simpler correct implementation whenever measurements stay inconclusive.
Files (cargo-modernize)
-
LICENSE 1 KB · in bundle
-
SKILL.md 2 KB
--- 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 wall-clock scan time, per-file 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, removing copies, intermediate collections, or repeated passes where measured gains outweigh added complexity and preserving streaming, ordering, and failure semantics. Prioritize startup or hot-path clones according to the metric that matters. **Layout and resource bounds.** Inspect size, enum variant skew, alignment, and indirection on high-volume types while keeping APIs clean until measurements justify layout changes. Keep queues, caches, buffers, and background tasks bounded so foreground latency wins never trade away memory or backpressure control. **Profiling and build trade-offs.** Pick the probe that isolates the bottleneck—`hyperfine` runs of `cargo modernize` over large real workspaces for end-to-end time, focused microbenchmarks for pure matcher or renderer operations, CPU profiles for parsing and detection, and heap profiles for retained syntax trees and caches—accounting for profiler overhead and separating cold from warm filesystem caches. Weigh allocator, LTO, codegen-unit, and build-speed trade-offs while keeping `panic = "unwind"` (required for per-file panic isolation), retaining the simpler correct implementation whenever measurements stay inconclusive.
Reviews (0)
No reviews yet.
Comments
Sign in to join the conversation.
No comments yet. Start the conversation.