agentleFS
DankosikDankosik/rust-cli-skills/skills/rust-performance/SKILL.md

rust-performance

Skill0 starsChanged 2 months agoMITView on GitHub

Use to assess or measure Rust CLI startup, runtime, throughput, CPU, or I/O concerns, or verify an optimization.

7 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use rust-unsafe-ffi, rust-macros and 2 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.
  • 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

  • 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 4 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

  • 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 3 projects that use this

The file

Files
SKILL.md

Rust Performance

Evidence. Identify the requested result: an audit, measurement, or optimization. Define the relevant workload and metric; establish a comparable baseline when measuring a change. Separate startup, time to first result, total runtime, throughput, memory, and binary size. Honor supplied requirements and preserve settled choices outside the requested change; resolve only what the task leaves open.

For whole-command measurements, measure an optimized executable directly; cargo run adds orchestration and possible build work. Keep toolchain, target, features, profile, input, and environment comparable. Define the relevant warm or cold cache condition and control output destinations; terminal rendering or a slow pipe can dominate computation.

Choose evidence that separates plausible causes: CPU samples for computation, allocation profiles for churn, syscall or I/O evidence for repeated operations and waiting. Account for profiler overhead. Inspect complexity, repeated parsing, formatting, copies, and unnecessary initialization before changing low-level mechanics.

When whole-command speed is the claim, compare repeated samples with an existing suitable tool such as hyperfine. Use a microbenchmark for a specific operation, with realistic inputs and observable results; it cannot establish whole-command improvement. Select the comparison and sample plan before measuring, and retain variance rather than rerunning until a favorable sample appears.

Treat LTO, codegen units, optimization level, allocator changes, SIMD, and PGO as measured alternatives. Smaller code and maximum optimization settings do not guarantee faster execution. Preserve the target CPU baseline; native CPU tuning is unsuitable for a generally distributed binary unless that compatibility limit is deliberate.

For an audit without runtime evidence, report code-supported properties separately from bottleneck hypotheses and propose discriminating observations without editing. For benchmarking, report the comparison without requiring a code change. For an authorized optimization, verify output, errors, ordering, and resource bounds alongside speed; report before-and-after evidence and its limits. If evidence is unavailable or inconclusive, state that and prefer the simpler correct implementation rather than inventing a speedup or adding a new profiling platform.

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.