Agent skill

Rust Performance

by caarlos0 in caarlos0/dotfiles

Profile and optimize Rust CPU, memory, I/O, async, and build performance with representative benchmarks.

MITAuto-check passedDevelopment

Install Rust Performance

skills CLI
$ npx skills add caarlos0/dotfiles --skill rust-performance -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install caarlos0/dotfiles rust-performance --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/caarlos0/dotfiles.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/rust-performance .claude/skills/rust-performance && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
rust-performance
GitHub stars
220
Token cost
~1.3k tokens
SKILL.md length
660 words
Files
1
Skills in repo
20
Repo updated
First seen
Licence
MIT

At a glance

Profile and optimize Rust CPU, memory, I/O, async, and build performance with representative benchmarks.

  • Development work in your project
  • SKILL.md covers Measure Rust, not debug builds, Allocations and ownership, Iterators, strings, and bytes and I/O, plus 4 more sections
  • Calls cargo

What it does

Rust Performance is an agent skill from caarlos0/dotfiles. Profile and optimize Rust CPU, memory, I/O, async, and build performance with representative benchmarks.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. It works with Rust. The licence is MIT.

When your agent uses it

  • Development work in your project

Example prompts

  • “/rust-performance”

What it can do on your machine

Read from SKILL.md and the folder at commit 278c761. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Rust Performance loads about 1.3k tokens when it runs. Until then it costs about 30 tokens; SKILL.md has 660 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~30
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from caarlos0/dotfiles at commit 278c761, republished under its MIT licence (© caarlos0). 660 words, ~1,293 tokens.

Download SKILL.mdSave it as .claude/skills/rust-performance/SKILL.md (or your agent's skills folder).
name
rust-performance
description
Profile and optimize Rust CPU, memory, I/O, async, and build performance with representative benchmarks.

Rust Performance

Profile first, then change one measured bottleneck. Report the workload, tool, target, toolchain, build profile, and before/after values.

Measure Rust, not debug builds

Use optimized code with symbols:

toml
[profile.profiling]
inherits = "release"
debug = "line-tables-only"

Use Criterion for microbenchmarks and std::hint::black_box only where the compiler could fold inputs or remove results. For CPU profiles use the repository's profiler, samply, perf, Instruments, or cargo flamegraph. Use DHAT or an allocation profiler when CPU samples point to allocation.

Allocations and ownership

  • Pre-size known growth with Vec::with_capacity, String::with_capacity, and HashMap::with_capacity.
  • Use clone_from when replacing an existing value can reuse its allocation.
  • Use Cow at boundaries where most callers borrow and few need ownership. Do not spread it through APIs without evidence; it adds branching and type complexity.
  • SmallVec and other inline collections help only when the observed length distribution usually fits inline. Their inline storage increases value and stack size.
  • Inspect hot type sizes with size_of, -Zprint-type-sizes, or a type-size tool. Box a rare large enum variant only when shrinking the common value improves the workload.
  • Reuse buffers across iterations when ownership is clear. Do not pool small values whose allocation is not visible in a profile.

For maps, use the entry API to avoid duplicate lookups and reserve capacity when the size is known. Alternative hashers trade collision resistance, dependencies, and portability for throughput; use them only for trusted keys after representative key-distribution benchmarks.

Iterators, strings, and bytes

  • Implement an accurate size_hint for custom iterators consumed by collect or extend.
  • Avoid collect when the result is immediately iterated once; keep the chain lazy. Collect when ownership, sorting, indexing, or reuse requires it.
  • Prefer iterating slices to repeated indexing in hot loops; this often makes bounds-check elimination easier.
  • Reuse String, Vec<u8>, or bytes::BytesMut buffers instead of formatting or allocating per item. Work with &[u8] for genuinely byte-oriented data; do not discard Unicode or path semantics for speed.
  • Keep Path/OsStr values native. Avoid string conversion solely for comparison or joining.

I/O

Use BufReader/BufWriter for repeated small operations and choose capacity from observed request sizes. Batch writes and reuse read buffers. Preserve partial-write handling, flush errors, EOF behavior, and output ordering; a faster path that changes them is incorrect.

Show full SKILL.md (301 more words)Show less

Async and concurrency

  • Never perform long CPU work, blocking syscalls, or synchronous sleeps on an async executor thread. Use spawn_blocking for bounded blocking work and Rayon or a dedicated pool for sustained CPU parallelism.
  • Prefer std::sync::Mutex when the guard never crosses .await; use an async mutex only when it must. Profile contention before replacing either.
  • Use bounded channels when producers can outrun consumers. Select mpsc, oneshot, watch, or broadcast from message semantics, not benchmark folklore.
  • Audit cancellation and losing select! branches before batching or buffering. Work discarded on cancellation is still cost.
  • Account for oversubscription when Tokio blocking threads, Rayon, native libraries, and application threads share the same CPUs.
  • Check task ownership, queue depth, and shutdown. Leaked tasks and unbounded queues commonly look like memory or latency regressions.

Invoke runtime-process-debugging for process, pipe, EOF, child-lifecycle, or shutdown stalls.

Build and low-level tuning

Benchmark lto, codegen-units, opt-level, panic strategy, allocator, PGO, and linker changes separately. target-cpu=native is valid only for fixed deployment hardware; it makes distributed artifacts non-portable.

Before adding SIMD or unsafe, verify the hot instruction sequence and whether the compiler already removed bounds checks or vectorized it. Prefer safe loop shapes first. Every unsafe optimization needs a precise invariant, tests that exercise it, and a measured win over the safe version.

Regression guards

Use a focused Criterion benchmark, allocation guard, or compile-time size assertion only for the invariant that matters. Keep wall-time on shared CI advisory unless hardware and variance are controlled. Pin the Rust toolchain when compiler code generation affects the comparison.

  • rust-specialist takes precedence for correctness, safety, and API design.
  • code-review checks a completed diff. When invoked from code-review, do not invoke it again.
  • code-simplifier runs after the gain is proven and preserves measured behavior.
  • runtime-process-debugging owns process and lifecycle stalls.

Correctness and safety override performance.

© caarlos0, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/rust-performance of caarlos0/dotfiles.

Open the folder on GitHubat commit 278c761

Compare with similar skills

Rust Performance next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Rust Performance compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rust Performance this skillcaarlos0/dotfiles220—~1.3kAutomated safety check: PassMIT
Migrate Core Code to Submodulestinyhumansai/openhuman41k—~2.6kAutomated safety check: PassGPL-3.0
Rust Best Practicesfarm-fe/farm5.6k3 repos~1.1kAutomated safety check: PassMIT
OpenLogi macOS Permissions TriageAprilNEA/OpenLogi23k—~2.5kAutomated safety check: NotesApache-2.0
RTK Rust Design Patternsrtk-ai/rtk83k—~1.9kAutomated safety check: PassApache-2.0
Release Skillsnexmoe/eve4213 repos~3.3kAutomated safety check: PassNone

Similar skills

  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    41k GitHub stars~2.6k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.

    5.6k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Decides whether an OpenLogi device problem on macOS is a privacy-permission (TCC) problem, using agent log lines, and says which identity needs which grant.

    23k GitHub stars~2.5k tokensUpdated 4 days ago
    DevelopmentAuto-check: notes
  • Describes seven Rust design patterns for the RTK CLI filter modules, with when to use each, RTK examples, and notes on when a pattern is overkill.

    83k GitHub stars~1.9k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Release Skills

    nexmoe/eve

    Universal release workflow. An agent skill from nexmoe/eve.

    421 GitHub starsUsed in 3 repos~3.3k tokens
    DevelopmentAuto-check passed
  • Pnpm Engine

    teambit/bit

    Work on the pnpm Rust engine (@pnpm/napi, the pacquet crates) that bit install runs through.

    18k GitHub stars~1.9k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from caarlos0/dotfiles

All 20 skills in this repo
  • CLI Design

    caarlos0/dotfiles

    Design and review command-line interfaces for usability, automation, safety, accessibility, and long-term compatibility.

    220 GitHub stars~4.2k tokensUpdated today
    Auto-check passed
  • Dependabot Merge

    caarlos0/dotfiles

    Review and merge open dependency pull requests from Dependabot, Renovate and similar bots across the goreleaser organization and the caarlos0 user.

    220 GitHub stars~5k tokensUpdated today
    Auto-check passed
  • Gh CLI

    caarlos0/dotfiles

    Use GitHub CLI efficiently for pull requests, CI checks, workflow runs, logs, and merge status.

    220 GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Tui Design

    caarlos0/dotfiles

    Design terminal user interfaces and interactive CLIs that stay usable, accessible, and scriptable.

    220 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Dashboard

    caarlos0/dotfiles

    Design and review dashboards that are informative, honest, accessible, and visually polished, independent of any tool.

    220 GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • Gh Doc Author

    caarlos0/dotfiles

    Author and revise clear GitHub internal documentation, including design docs, proposals, decision records, runbooks, status updates, and handoffs.

    220 GitHub stars~2.2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Rust Performance

What does Rust Performance do?

Profile and optimize Rust CPU, memory, I/O, async, and build performance with representative benchmarks. Rust Performance is an agent skill from caarlos0/dotfiles. Profile and optimize Rust CPU, memory, I/O, async, and build performance with representative benchmarks.

When should I use Rust Performance?

Rust Performance fits situations like: development work in your project.

How do I install Rust Performance in Claude Code?

Run `npx skills add caarlos0/dotfiles --skill rust-performance -a claude-code`. Or copy the skill folder (skills/rust-performance in caarlos0/dotfiles) into .claude/skills/rust-performance in your project. Claude Code loads it when a task matches its description.

How do I install Rust Performance in Codex?

Run `npx skills add caarlos0/dotfiles --skill rust-performance -a codex`. Or copy the skill folder (skills/rust-performance in caarlos0/dotfiles) into .agents/skills/rust-performance in your project. Codex loads it when a task matches its description.

Can I use Rust Performance in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add caarlos0/dotfiles --skill rust-performance -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rust-performance, .gemini/skills/rust-performance, .github/skills/rust-performance and .opencode/skills/rust-performance in your project.

What does Rust Performance need to run?

Going by SKILL.md and its folder, Rust Performance needs the command-line tools its instructions call (cargo).

Does Rust Performance access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Rust Performance safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Rust Performance use?

Rust Performance is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rust Performance use?

About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Rust Performance?

Skills that share tags, products or a category with Rust Performance: Migrate Core Code to Submodules (tinyhumansai/openhuman, 41k stars), Rust Best Practices (farm-fe/farm, 5.6k stars), OpenLogi macOS Permissions Triage (AprilNEA/OpenLogi, 23k stars) and RTK Rust Design Patterns (rtk-ai/rtk, 83k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rust Performance?

caarlos0 (a GitHub user) maintains it in caarlos0/dotfiles, which has 220 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on October 7, 2026.

Source: caarlos0/dotfiles on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.