用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-rust --skill rust-performance命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | rust-performance |
| description | Master Rust performance - profiling, benchmarking, and optimization |
| sasmp_version | 1.3.0 |
| bonded_agent | rust-debugger-agent |
| bond_type | SECONDARY_BOND |
| version | 1.0.0 |
Master performance optimization: profiling, benchmarking, and zero-cost abstractions.
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
[[bench]]
name = "my_bench"
harness = false
use criterion::{criterion_group, criterion_main, Criterion, black_box};
fn benchmark(c: &mut Criterion) {
c.bench_function("fib", |b| {
b.iter(|| fibonacci(black_box(20)))
});
}
criterion_group!(benches, benchmark);
criterion_main!(benches);
cargo install flamegraph
cargo flamegraph --bin my-app
// ❌ Allocates each iteration
for s in strings {
result = result + &s;
}
// ✅ Pre-allocate
let mut result = String::with_capacity(total_len);
for s in strings {
result.push_str(&s);
}
// ❌ Intermediate collection
let v: Vec<_> = data.iter().map(|x| x * 2).collect();
let sum: i32 = v.iter().sum();
// ✅ Lazy chain
let sum: i32 = data.iter().map(|x| x * 2).sum();
use std::borrow::Cow;
fn process(input: &str) -> Cow<str> {
if input.contains("bad") {
Cow::Owned(input.replace("bad", "good"))
} else {
Cow::Borrowed(input)
}
}
[profile.release]
lto = true
codegen-units = 1
opt-level = 3
| Problem | Solution |
|---|---|
| Slow debug | Use --release |
| Memory spikes | Use streaming |
| Cache misses | Improve data layout |