npx skills add https://github.com/pproenca/dot-skills --skill rustRust 应用程序的全面性能优化指南。包含 8 个类别共 42 条规则,按影响优先级排序,以指导自动化重构和代码生成。
在以下情况下参考这些指南:
| 优先级 | 类别 | 影响 | 前缀 |
|---|---|---|---|
| 1 | 内存分配 | 关键 | mem- |
| 2 | 所有权与借用 | 关键 | own- |
| 3 | 数据结构选择 | 高 | ds- |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 4 | 迭代器与集合模式 | 高 | iter- |
| 5 | 异步与并发 | 中高 | async- |
| 6 | 算法复杂度 | 中 | algo- |
| 7 | 编译时优化 | 中 | comp- |
| 8 | 微优化 | 低 | micro- |
mem-avoid-unnecessary-clone - 避免不必要的 clone 调用mem-preallocate-vec-capacity - 预分配 Vec 容量mem-use-cow-for-conditional-ownership - 使用 Cow 处理条件所有权mem-use-arc-for-shared-immutable-data - 使用 Arc 共享不可变数据mem-avoid-format-for-simple-concatenation - 避免使用 format! 进行简单字符串拼接mem-use-smallvec-for-small-collections - 对小集合使用 SmallVecown-accept-str-slice-not-string - 接受 &str 而非 &Stringown-accept-slice-not-vec - 接受 &[T] 而非 &Vecown-use-into-for-flexible-ownership - 使用 Into 实现灵活的所有权own-return-borrowed-when-possible - 尽可能返回借用数据own-use-asref-for-generic-borrows - 使用 AsRef 进行泛型借用ds-use-hashset-for-membership - 使用 HashSet 进行成员测试ds-use-hashmap-for-key-lookup - 使用 HashMap 进行键值查找ds-use-btreemap-for-sorted-iteration - 使用 BTreeMap 进行有序迭代ds-use-vecdeque-for-queue-operations - 使用 VecDeque 进行队列操作ds-use-entry-api-for-conditional-insert - 使用 Entry API 进行条件插入iter-chain-instead-of-intermediate-collect - 链接迭代器而非中间 collectiter-use-iter-over-into-iter-when-borrowing - 借用时使用 iter() 而非 into_iter()iter-use-filter-map-for-combined-operations - 使用 filter_map 进行组合操作iter-use-flat-map-for-nested-iteration - 使用 flat_map 进行嵌套迭代iter-use-extend-for-bulk-append - 使用 extend() 进行批量追加iter-use-fold-for-accumulation - 使用 fold() 进行复杂累加async-avoid-blocking-in-async-context - 避免在异步上下文中阻塞async-use-join-for-concurrent-futures - 使用 join! 处理并发 futureasync-use-rwlock-over-mutex-for-read-heavy - 读多场景下使用 RwLock 而非 Mutexasync-minimize-lock-scope - 最小化锁的作用域async-use-buffered-for-bounded-concurrency - 使用 buffered() 实现有界并发async-avoid-holding-lock-across-await - 避免跨 await 持有锁algo-avoid-nested-loops-for-lookup - 避免使用嵌套循环进行查找algo-use-binary-search-for-sorted-data - 对已排序数据使用二分查找algo-use-sort-unstable-when-order-irrelevant - 顺序无关时使用 sort_unstablealgo-use-select-nth-unstable-for-partial-sort - 使用 select_nth_unstable 进行部分排序algo-use-chunks-for-batch-processing - 使用 chunks() 进行批处理comp-use-const-for-compile-time-computation - 使用 const 进行编译时计算comp-prefer-static-dispatch - 优先使用静态分发而非动态分发comp-reduce-monomorphization-bloat - 减少单态化膨胀comp-use-const-generics-for-array-sizes - 使用常量泛型指定数组大小comp-avoid-repeated-parsing-of-static-data - 避免重复解析静态数据micro-use-inline-for-small-functions - 对小而热门的函数应用 inline 属性micro-avoid-bounds-checks-in-hot-loops - 在热点循环中避免边界检查micro-use-wrapping-arithmetic-when-safe - 安全时使用包装算术micro-use-byte-literals-for-ascii - 对 ASCII 字符使用字节字面量阅读单独的参考文件以获取详细解释和代码示例:
要获取包含所有规则的完整指南,请参阅 AGENTS.md。
| 文件 | 描述 |
|---|---|
| AGENTS.md | 包含所有规则的完整编译指南 |
| references/_sections.md | 类别定义和排序 |
| assets/templates/_template.md | 新规则模板 |
| metadata.json | 版本和参考信息 |
每周安装量
124
代码仓库
GitHub 星标数
85
首次出现
2026年1月22日
安全审计
安装于
opencode101
claude-code100
codex98
gemini-cli98
github-copilot94
cursor86
Comprehensive performance optimization guide for Rust applications. Contains 42 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Memory Allocation | CRITICAL | mem- |
| 2 | Ownership & Borrowing | CRITICAL | own- |
| 3 | Data Structure Selection | HIGH | ds- |
| 4 | Iterator & Collection Patterns | HIGH | iter- |
| 5 | Async & Concurrency | MEDIUM-HIGH | async- |
| 6 | Algorithm Complexity | MEDIUM | algo- |
| 7 | Compile-Time Optimization | MEDIUM | comp- |
| 8 | Micro-optimizations | LOW | micro- |
mem-avoid-unnecessary-clone - Avoid unnecessary clone callsmem-preallocate-vec-capacity - Preallocate Vec capacitymem-use-cow-for-conditional-ownership - Use Cow for conditional ownershipmem-use-arc-for-shared-immutable-data - Use Arc for shared immutable datamem-avoid-format-for-simple-concatenation - Avoid format! for simple concatenationown-accept-str-slice-not-string - Accept &str instead of &Stringown-accept-slice-not-vec - Accept &[T] instead of &Vecown-use-into-for-flexible-ownership - Use Into for flexible ownershipown-return-borrowed-when-possible - Return borrowed data when possibleown-use-asref-for-generic-borrows - Use AsRef for generic borrowsds-use-hashset-for-membership - Use HashSet for membership testsds-use-hashmap-for-key-lookup - Use HashMap for key-value lookupsds-use-btreemap-for-sorted-iteration - Use BTreeMap for sorted iterationds-use-vecdeque-for-queue-operations - Use VecDeque for queue operationsds-use-entry-api-for-conditional-insert - Use Entry API for conditional insertiter-chain-instead-of-intermediate-collect - Chain iterators instead of intermediate collectiter-use-iter-over-into-iter-when-borrowing - Use iter() over into_iter() when borrowingiter-use-filter-map-for-combined-operations - Use filter_map for combined operationsiter-use-flat-map-for-nested-iteration - Use flat_map for nested iterationiter-use-extend-for-bulk-append - Use extend() for bulk appendasync-avoid-blocking-in-async-context - Avoid blocking in async contextasync-use-join-for-concurrent-futures - Use join! for concurrent futuresasync-use-rwlock-over-mutex-for-read-heavy - Use RwLock over Mutex for read-heavyasync-minimize-lock-scope - Minimize lock scopeasync-use-buffered-for-bounded-concurrency - Use buffered() for bounded concurrencyalgo-avoid-nested-loops-for-lookup - Avoid nested loops for lookupsalgo-use-binary-search-for-sorted-data - Use binary search for sorted dataalgo-use-sort-unstable-when-order-irrelevant - Use sort_unstable when order irrelevantalgo-use-select-nth-unstable-for-partial-sort - Use select_nth_unstable for partial sortalgo-use-chunks-for-batch-processing - Use chunks() for batch processingcomp-use-const-for-compile-time-computation - Use const for compile-time computationcomp-prefer-static-dispatch - Prefer static dispatch over dynamiccomp-reduce-monomorphization-bloat - Reduce monomorphization bloatcomp-use-const-generics-for-array-sizes - Use const generics for array sizescomp-avoid-repeated-parsing-of-static-data - Avoid repeated parsing of static datamicro-use-inline-for-small-functions - Apply inline attribute to small hot functionsmicro-avoid-bounds-checks-in-hot-loops - Avoid bounds checks in hot loopsmicro-use-wrapping-arithmetic-when-safe - Use wrapping arithmetic when safemicro-use-byte-literals-for-ascii - Use byte literals for ASCIIRead individual reference files for detailed explanations and code examples:
For a comprehensive guide with all rules in a single document, see AGENTS.md.
| File | Description |
|---|---|
| AGENTS.md | Complete compiled guide with all rules |
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
Weekly Installs
124
Repository
GitHub Stars
85
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode101
claude-code100
codex98
gemini-cli98
github-copilot94
cursor86
TanStack Query v5 完全指南:React 数据管理、乐观更新、离线支持
2,500 周安装
mem-use-smallvec-for-small-collectionsiter-use-fold-for-accumulation - Use fold() for complex accumulationasync-avoid-holding-lock-across-await