rust-perf
Rust performance and memory optimization for Skill Doctor L1.
Skill by KalarisLabs
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/kalarislabs-rust-perf
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/rust-perf
What's inside
- Skill name
rust-perf- Description
- Rust performance and memory optimization for Skill Doctor L1. Use when making scans faster, reducing RSS or binary size, adding rayon/mmap, writing benchmarks, or discussing the §7.3 targets (2000 skills/min, 40MB, 12MB binary, 15s cold).
- License
- Apache-2.0
- Instructions
- 67 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Rust performance Load this before optimizing. Do **not** sacrifice invariants (determinism, additive-only, no mandatory LLM) for speed. ## Pre-registered targets (§7.3) — not measured results Treat these as the optimization budget. Write them into benches as `assert` ceilings once harness exists. Until then, design so they are reachable. Never publish a number as measured unless `sd-bench/RESULTS.md` was produced by the harness on a tagged release. | Metric | Target | |--------|--------| | Throughput (offline L1, warm cache off) | **≥ 2,000 skills/min** | | Peak RSS | **< 40 MB** | | Install | **one binary, ~12 MB, zero runtime deps** | | Cold install → first result | **< 15 s** | Parity with Cisco/NVIDIA on synthetic TPR is the detection claim; **adoption** is this table. Competitors cannot move install footprint without leaving Python. ## What to optimize (in order) 1. **Do not compile YARA at scan time.** `build.rs` once. Scan = match. 2. **mmap** skill files with `memmap2` when size > ~64 KiB. Keep small files on the stack/heap. 3. **Zero extra alloc on the miss path.** A clean skill should not build a `Vec<Finding>` of zeros then throw it away — return empty slice / `SmallVec`. 4. **Rayon over files and engines**, not over lines inside one 2 KB SKILL.md. 5. **Sorted walk once.** Determinism and perf: `ignore`/`walkdir` → collect → `sort` → process. 6. **Canonical digest** over sorted `(path, content)` pairs; hash streaming, not a giant concatenated `String`. 7. **No tokio, no async, no reqwest** on the default path. Async startup cost kills cold-install. 8. **Binary size:** default features slim. `LTO=thin` in release profile. `strip = true`. Avoid `tokio`+`reqwest`+`openssl` in the default binary (use rustls only if L4 is on). Target ~12 MB **stripped musl**. 9. **RSS:** do not hold every file's bytes after L1 on that file finishes. Drop mmaps per file. Global caches are digest → findings, bounded. 10. **Ruleset** is embedded bytes, not a temp directory of `.yar` files at runtime. ## Forbidden “optimizations” - Skipping Unicode/SD-11 work on the L2 path to go faster (L2 is optional; L1 unicode still runs). - Unordered `HashMap` iteration in reports (breaks determinism). Use `BTreeMap` or sort before serialize. - `parallel` + unsynchronized `Vec::push`. - Adding an LLM “to filter false positives” on the hot path. - `cargo build --release` numbers copied into the paper. Paper values stay **targets** until RESULTS.md. ## How to measure ```bash cargo build -p skill-doctor --release /usr/bin/time -v ./target/release/skill-doctor scan-all ./tests/fixtures --offline --deterministic # RSS = Maximum resident set size # Throughput = fixtures / wall time * 60 ``` Prefer `criterion` or a fixed `benches/` once the scan path exists. Pin fixture counts. Do not use `std::time` in unit tests as a pass/fail speed gate (too noisy on CI). Put performance gates in `sd-bench` or a dedicated `perf.yml` nightly job, not in the every-commit clippy job. ## Release profile (root Cargo.toml) ```toml [profile.release] lto = "thin" codegen-units = 1 opt-level = 3 strip = true panic = "abort" # binary only; libraries stay unwind if tests need it ``` Use `panic = "abort"` only on the binary package via `[profile.release.package.skill-doctor]` if tests need unwind. ## Mental model Cold install < 15 s means: static musl binary on PATH, no `pip`, no model pull, no rule compile, first `scan` of a small skill is dominated by process start + mmap + YARA match. If you add a runtime that downloads models or compiles rules, you have missed the target on purpose.
From KalarisLabs/Skill-Doctor, Apache-2.0.
More from KalarisLabs/Skill-Doctor
- 0.596score
rust-idioms
KalarisLabs
Everyday Rust engineering for Skill Doctor — errors, ownership, clippy, APIs, iterators.
SkillBFreshness: B★ 13Claude Code +9 - 0.596score
project-context
KalarisLabs
Skill Doctor product and architecture context.
SkillBFreshness: B★ 13Claude Code +9 - 0.596score
rust-workspace
KalarisLabs
Cargo workspace layout, crate boundaries, and dependency policy for Skill Doctor.
SkillBFreshness: B★ 13Claude Code +9 - 0.596score
rust-invariants
KalarisLabs
Nine non-negotiable Skill Doctor product invariants.
SkillBFreshness: B★ 13Claude Code +9 - 0.596score
ci-cd
KalarisLabs
GitHub Actions, required checks, TestMu, OS matrix, and merge gates for Skill Doctor.
SkillBFreshness: B★ 13Claude Code +9 - 0.596score
rust-testing
KalarisLabs
How to write Skill Doctor tests — unit, integration, CLI, fixtures, determinism, additive-only.
SkillBFreshness: B★ 13Claude Code +9 - 0.596score
rust-skills
leonardomso
Comprehensive Rust coding guidelines with 265 rules across 26 categories.
SkillBFreshness: B★ 13Claude Code +9 - 0.591score
neutralize-sd11
KalarisLabs
SD-11 scanner-mediated injection — neutralize untrusted skill bytes before any model; additive-only scoring.
SkillBFreshness: B★ 13Claude Code +9 - 0.591score
unsafe-sandbox
KalarisLabs
Rules for unsafe Rust and the L3 behavioral process harness.
SkillBFreshness: B★ 13Claude Code +9 - 0.591score
release-publish
KalarisLabs
Pre-publish and publish path for crates.io, npm installer, GitHub Releases, SBOM.
SkillBFreshness: B★ 13Claude Code +9 - 0.591score
yara-rules
KalarisLabs
Author and compile YARA-X rules for SDTM-v1.
SkillBFreshness: B★ 13Claude Code +9 - 0.591score
cli-sarif
KalarisLabs
Skill Doctor CLI UX, flags, exit codes, text/JSON/SARIF reports.
SkillBFreshness: B★ 13Claude Code +9
Signals
- Stars
- 13
- Forks
- 1
- Open issues
- 30
- Last commit (this folder)
- Sep 10, 2026 (1 month ago)
- Last release
- Sep 12, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/KalarisLabs/Skill-Doctor
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from KalarisLabs
- 0.596score
rust-idioms
KalarisLabs
Everyday Rust engineering for Skill Doctor — errors, ownership, clippy, APIs, iterators.
SkillBFreshness: B★ 13Claude Code +9 - 0.596score
rust-invariants
KalarisLabs
Nine non-negotiable Skill Doctor product invariants.
SkillBFreshness: B★ 13Claude Code +9 - 0.596score
rust-testing
KalarisLabs
How to write Skill Doctor tests — unit, integration, CLI, fixtures, determinism, additive-only.
SkillBFreshness: B★ 13Claude Code +9 - 0.596score
ci-cd
KalarisLabs
GitHub Actions, required checks, TestMu, OS matrix, and merge gates for Skill Doctor.
SkillBFreshness: B★ 13Claude Code +9 - 0.596score
project-context
KalarisLabs
Skill Doctor product and architecture context.
SkillBFreshness: B★ 13Claude Code +9 - 0.596score
rust-workspace
KalarisLabs
Cargo workspace layout, crate boundaries, and dependency policy for Skill Doctor.
SkillBFreshness: B★ 13Claude Code +9
Cite this page
rust-perf skill. Agent Mart. https://agentmart.dev/skills/kalarislabs-rust-perf (last updated 2026-10-24)