agentleFS
DankosikDankosik/cargo-modernize/.agents/skills/rust-performance/SKILL.md

rust-performance

Skill0 starsChanged 5 days agoApache-2.0View on GitHub

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

12 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use rust-macros, rust-cli and 4 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • dawidpereiraSkill

    rust-macros

    Rust macros — macro_rules!, proc macros, derive macros, attribute macros, fragment specifiers, repetition, hygiene, cargo expand, when to use macros vs generics. Use when writing or debugging declarative or procedural macros, choosing between macros and other abstractions, understanding expansion errors, or generating repetitive code.

    Also in 5 projects that use this

  • tumfSkill

    rust-cli

    Design and implementation guidance for maintainable Rust CLIs with strong ergonomics, machine-friendly behavior, testable structure, and release automation. Use when creating or refactoring a Rust command-line tool, choosing crates like clap/anyhow/tracing/serde_json, improving command UX, adding JSON output, tightening test/release workflows, or making an existing CLI safer for agents and automation.

    Also in 5 projects that use this

  • botirkhaltaevSkill

    rust-unsafe-ffi

    Master unsafe Rust, FFI, and foreign function interface programming. Use when writing unsafe Rust code with raw pointers, interfacing with C/C++ libraries, creating bindings with bindgen, implementing zero-cost abstractions, working with uninitialized memory, or understanding the safety/unsafety boundary.

    Also in 3 projects that use this

  • adxptivedSkill

    rust-api-design

    Rust API Design guidelines, naming conventions, and best practices. Use when: - User is designing a library, crate, or public APIs - Implementing patterns like Builder, Typestate, or Extension traits - Designing public structures, enums, or traits - Working with common traits (From/Into, Default, AsRef, Debug, Clone) - Applying #[must_use] or #[non_exhaustive] attributes - Restricting trait implementation via Sealed Traits - Formatting naming structures and lifetime designs

    Also in 4 projects that use this

  • codecharmhqSkill

    rust-error-handling

    Use when writing Rust error types, choosing between Result and panic, or when building library error APIs with thiserror/anyhow

    Also in 3 projects that use this

  • CloudflareSkill

    rust-review

    Rust code review for workerd. Covers CXX FFI safety, unsafe code patterns, JSG resource conventions, error handling, and a review checklist adapted from the C++ review skills. Load this skill when reviewing Rust code in src/rust/.

    Also in 3 projects that use this

The file

Files
SKILL.md

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.