— No reviews yet
0 installs
5 views
0.0% view→install
Install
$ agentstack add skill-caraya-agent-skills-rust-performance ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Are you the author of Rust Performance? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claimAbout
Rust Performance
Use When
- Profiling Rust applications for CPU, memory, or latency bottlenecks.
- Benchmarking hot paths with criterion.
- Analyzing allocation patterns and reducing heap usage.
- Optimizing compilation time in large workspaces.
Profiling Tools
- Benchmarking
criterion: Statistical benchmarking library.- Add to
Cargo.toml:criterion = { version = "0.5", features = ["html_reports"] }. - Run:
cargo bench. cargo bench(built-in): Simple benchmarks via#[bench](nightly only).
- CPU profiling
- perf (Linux):
perf record -g cargo run --release && perf report. - Instruments (macOS): Use with
cargo build --releaseand attach to process. - flamegraph:
cargo flamegraphgenerates SVG flame graphs.
- Memory and allocation analysis
- heaptrack (Linux): Tracks heap allocations with call stacks.
- dhat (via valgrind): Detailed heap profiling.
- jemalloc with stats: Use
tikv-jemallocatorfor allocation statistics.
- Compilation performance
cargo build --timings: Generates HTML report of crate build times.cargo llvm-lines: Shows which functions generate the most LLVM IR lines.
Checklist
- Benchmarking and baselines
- Use
criterionfor reliable, statistically valid micro-benchmarks. - Always benchmark release builds (
cargo benchuses release by default). - Establish a baseline before and after optimizations.
- CPU and hot paths
- Profile with flamegraph to find high-CPU functions.
- Avoid unnecessary clones, allocations, and copies in hot paths.
- Use iterators with zero-cost abstractions; prefer
iter()over manual indexing.
- Memory and allocations
- Use
cargo benchwith--features dhat-heapto count allocations per operation. - Preallocate
VecandHashMapwithwith_capacity()when size is known. - Use
Box,Rc, orArconly at ownership boundaries, not for routine values. - Consider stack allocation or arena allocators for high-frequency short-lived objects.
- Compilation time
- Use
cargo build --timingsto find slow-compiling crates. - Reduce generic monomorphization: avoid deeply nested generics in hot paths.
- Split large modules into smaller crates to enable parallel compilation.
- Use
dylibfor frequently rebuilt dev dependencies when appropriate.
- Async performance
- Avoid blocking calls inside async tasks; use
spawn_blockingfor CPU-heavy work. - Minimize
Arc>contention; prefer message-passing via channels. - Check task scheduling with
tokio-consolefor stalls or starvation.
Output Requirements
For each finding provide:
- Measurement (criterion output, flamegraph, allocation count).
- Root cause (CPU, allocation, clone, async contention, compile time).
- Optimization strategy with expected improvement.
- Effort and risk assessment (safe vs. unsafe optimization).
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: caraya
- Source: caraya/agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.