agentleFS
jscott3201jscott3201/yet-more-skills/skills/rust-performance/SKILL.md

rust-performance

Skill4 starsChanged 2 months agoApache-2.0View on GitHub

Profile, benchmark, or optimize Rust latency, throughput, CPU, or memory. Requires a workload and correctness contract; not a license for speculative rewrites.

7 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use rust-macros and rust-cli.

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

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Treat optimization as an experiment with a reject option.

    line 9
  2. Distinctive:

    Run correctness checks before and after.

    line 25
  3. Distinctive:

    Keep a change when the relevant improvement is credible and complexity/regressions are acceptable.

    line 35
  4. Distinctive:

    Read measurement recipes or optimization choices as needed.

    line 39

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Rust Performance Engineering

Treat optimization as an experiment with a reject option. If the repository already uses a performance A/B review skill, provide the Rust-specific work under that workflow instead of adding another review gate.

Define the useful result

Name the workload, metric, baseline behavior, and allowed semantic change. Distinguish codec cost, end-to-end request latency, throughput at a given concurrency, tail latency under saturation, retained memory, and cold-start behavior. An improvement in one does not establish the others.

Inspect existing harnesses and the actual hot path. Capture compiler/toolchain, Cargo profile, important flags/features, hardware/OS, workload scale, seed or data source, and whether caches are warm. Use an ordinary short benchmark note and saved output; do not build a new tracking system. Do not claim historical README numbers are measurements from this task.

Profile before redesign

Reproduce the issue in a native, representative build. Use CPU or allocation profiling according to the observed bottleneck. Inspect dominant work, allocation/copy boundaries, lock waits, queueing, repeated parsing, and invariant computation. Optimize algorithms, unnecessary work, data access, or ownership before reaching for instruction-level changes.

Prefer a small hypothesis: bind query-only state once, reuse a buffer within a clear lifetime, avoid a repeated lookup, batch work without violating ordering, or replace an unbounded structure with a justified bounded one. Estimate whether the hotspot is large enough to matter. Avoid blanket inline(always), unsafe indexing, a new allocator, fast hashers, or global CPU flags without evidence.

Compare fairly

Run correctness checks before and after. Preserve the workload, compiler, features, optimization settings, and timing boundary between A and B. When changing compiler or codegen is itself the experiment, vary that factor explicitly rather than attributing the change to source code.

Use repeated samples and an A/B/A or alternating order when host drift is plausible. Keep agents, builds, and unrelated benchmarks off the measurement host. Decide whether setup, destruction, allocation, scheduling, or persistence belongs inside the measured operation; do not remove real product costs just to improve the chart.

Inspect per-workload results and uncertainty, not only an average. For end-to-end services, include timeout/error rate, backlog, memory, and tail latency at the same offered load. Closed-loop clients can reduce offered load as the server slows; do not label their latency distribution as unconstrained service capacity.

For graph/vector work, evaluate quality against an exact or independent baseline as well as speed. Changing candidate coverage, scoring precision, or durability is not a free optimization. For SIMD, compare tiny, tail, and large inputs on available native architectures.

Decide and stop

Keep a change when the relevant improvement is credible and complexity/regressions are acceptable. Reject or label inconclusive when effects are small, noisy, workload-specific, or bought by weaker semantics. Do not keep tuning merely to obtain a positive result.

Return the hypothesis, commands, correctness evidence, baseline/candidate results with units and uncertainty, tradeoffs, and unmeasured platforms. No speedup claim from a build, smoke benchmark, or generated code inspection alone.

Read measurement recipes or optimization choices as needed.

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.