[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FEH2KWE616BKADE85X6FG8":3,"skill-same:01M6FEH2KWE616BKADE85X6FG8":47},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M6FEH2KWE616BKADE85X6FG8","rust-optimise",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fpproenca\u002Fdot-skills\u002Frust-optimise\u002FSKILL.md",[],[18,19],"rust","rust optimise","2026-11-10 10:12:30",false,"# Rust Optimise Best Practices\n\nPerformance optimization guide for Rust applications. Contains 42 rules across 8 categories, prioritized by impact from critical (memory allocation, ownership) to incremental (micro-optimizations).\n\n## When to Apply\n\n- Optimizing Rust code for performance or reducing allocations\n- Choosing data structures for optimal algorithmic complexity\n- Working with iterators to avoid unnecessary intermediate allocations\n- Writing async code with Tokio or other runtimes\n- Profiling hot paths and eliminating performance bottlenecks\n- Reviewing code for performance anti-patterns\n\n## Rule Categories by Priority\n\n| Priority | Category | Impact | Prefix |\n|----------|----------|--------|--------|\n| 1 | Memory Allocation | CRITICAL | `mem-` |\n| 2 | Ownership & Borrowing | CRITICAL | `own-` |\n| 3 | Data Structure Selection | HIGH | `ds-` |\n| 4 | Iterator & Collection Patterns | HIGH | `iter-` |\n| 5 | Async & Concurrency | MEDIUM-HIGH | `async-` |\n| 6 | Algorithm Complexity | MEDIUM | `algo-` |\n| 7 | Compile-Time Optimization | MEDIUM | `comp-` |\n| 8 | Micro-optimizations | LOW | `micro-` |\n\n## Quick Reference\n\n### 1. Memory Allocation (CRITICAL)\n\n- [`mem-avoid-unnecessary-clone`](references\u002Fmem-avoid-unnecessary-clone.md) - Avoid unnecessary clone calls\n- [`mem-preallocate-vec-capacity`](references\u002Fmem-preallocate-vec-capacity.md) - Preallocate Vec capacity\n- [`mem-use-cow-for-conditional-ownership`](references\u002Fmem-use-cow-for-conditional-ownership.md) - Use Cow for conditional ownership\n- [`mem-use-arc-for-shared-immutable-data`](references\u002Fmem-use-arc-for-shared-immutable-data.md) - Use Arc for shared immutable data\n- [`mem-avoid-format-for-simple-concatenation`](references\u002Fmem-avoid-format-for-simple-concatenation.md) - Avoid format! for simple concatenation\n- [`mem-use-smallvec-for-small-collections`](references\u002Fmem-use-smallvec-for-small-collections.md) - Use SmallVec for small collections\n\n### 2. Ownership & Borrowing (CRITICAL)\n\n- [`own-accept-str-slice-not-string`](references\u002Fown-accept-str-slice-not-string.md) - Accept &str instead of &String\n- [`own-accept-slice-not-vec`](references\u002Fown-accept-slice-not-vec.md) - Accept &[T] instead of &Vec\u003CT>\n- [`own-use-into-for-flexible-ownership`](references\u002Fown-use-into-for-flexible-ownership.md) - Use Into\u003CT> for flexible ownership\n- [`own-return-borrowed-when-possible`](references\u002Fown-return-borrowed-when-possible.md) - Return borrowed data when possible\n- [`own-use-asref-for-generic-borrows`](references\u002Fown-use-asref-for-generic-borrows.md) - Use AsRef\u003CT> for generic borrows\n\n### 3. Data Structure Selection (HIGH)\n\n- [`ds-use-hashset-for-membership`](references\u002Fds-use-hashset-for-membership.md) - Use HashSet for membership tests\n- [`ds-use-hashmap-for-key-lookup`](references\u002Fds-use-hashmap-for-key-lookup.md) - Use HashMap for key-value lookups\n- [`ds-use-btreemap-for-sorted-iteration`](references\u002Fds-use-btreemap-for-sorted-iteration.md) - Use BTreeMap for sorted iteration\n- [`ds-use-vecdeque-for-queue-operations`](references\u002Fds-use-vecdeque-for-queue-operations.md) - Use VecDeque for queue operations\n- [`ds-use-entry-api-for-conditional-insert`](references\u002Fds-use-entry-api-for-conditional-insert.md) - Use Entry API for conditional insert\n\n### 4. Iterator & Collection Patterns (HIGH)\n\n- [`iter-chain-instead-of-intermediate-collect`](references\u002Fiter-chain-instead-of-intermediate-collect.md) - Chain iterators instead of intermediate collect\n- [`iter-use-iter-over-into-iter-when-borrowing`](references\u002Fiter-use-iter-over-into-iter-when-borrowing.md) - Use iter() over into_iter() when borrowing\n- [`iter-use-filter-map-for-combined-operations`](references\u002Fiter-use-filter-map-for-combined-operations.md) - Use filter_map for combined operations\n- [`iter-use-flat-map-for-nested-iteration`](references\u002Fiter-use-flat-map-for-nested-iteration.md) - Use flat_map for nested iteration\n- [`iter-use-extend-for-bulk-append`](references\u002Fiter-use-extend-for-bulk-append.md) - Use extend() for bulk append\n- [`iter-use-fold-for-accumulation`](references\u002Fiter-use-fold-for-accumulation.md) - Use fold() for complex accumulation\n\n### 5. Async & Concurrency (MEDIUM-HIGH)\n\n- [`async-avoid-blocking-in-async-context`](references\u002Fasync-avoid-blocking-in-async-context.md) - Avoid blocking in async context\n- [`async-use-join-for-concurrent-futures`](references\u002Fasync-use-join-for-concurrent-futures.md) - Use join! for concurrent futures\n- [`async-use-rwlock-over-mutex-for-read-heavy`](references\u002Fasync-use-rwlock-over-mutex-for-read-heavy.md) - Use RwLock over Mutex for read-heavy\n- [`async-minimize-lock-scope`](references\u002Fasync-minimize-lock-scope.md) - Minimize lock scope\n- [`async-use-buffered-for-bounded-concurrency`](references\u002Fasync-use-buffered-for-bounded-concurrency.md) - Use buffered() for bounded concurrency\n- [`async-avoid-holding-lock-across-await`](references\u002Fasync-avoid-holding-lock-across-await.md) - Avoid holding lock across await\n\n### 6. Algorithm Complexity (MEDIUM)\n\n- [`algo-avoid-nested-loops-for-lookup`](references\u002Falgo-avoid-nested-loops-for-lookup.md) - Avoid nested loops for lookups\n- [`algo-use-binary-search-for-sorted-data`](references\u002Falgo-use-binary-search-for-sorted-data.md) - Use binary search for sorted data\n- [`algo-use-sort-unstable-when-order-irrelevant`](references\u002Falgo-use-sort-unstable-when-order-irrelevant.md) - Use sort_unstable when order irrelevant\n- [`algo-use-select-nth-unstable-for-partial-sort`](references\u002Falgo-use-select-nth-unstable-for-partial-sort.md) - Use select_nth_unstable for partial sort\n- [`algo-use-chunks-for-batch-processing`](references\u002Falgo-use-chunks-for-batch-processing.md) - Use chunks() for batch processing\n\n### 7. Compile-Time Optimization (MEDIUM)\n\n- [`comp-use-const-for-compile-time-computation`](references\u002Fcomp-use-const-for-compile-time-computation.md) - Use const for compile-time computation\n- [`comp-prefer-static-dispatch`](references\u002Fcomp-prefer-static-dispatch.md) - Prefer static dispatch over dynamic\n- [`comp-reduce-monomorphization-bloat`](references\u002Fcomp-reduce-monomorphization-bloat.md) - Reduce monomorphization bloat\n- [`comp-use-const-generics-for-array-sizes`](references\u002Fcomp-use-const-generics-for-array-sizes.md) - Use const generics for array sizes\n- [`comp-avoid-repeated-parsing-of-static-data`](references\u002Fcomp-avoid-repeated-parsing-of-static-data.md) - Avoid repeated parsing of static data\n\n### 8. Micro-optimizations (LOW)\n\n- [`micro-use-inline-for-small-functions`](references\u002Fmicro-use-inline-for-small-functions.md) - Apply inline attribute to small hot functions\n- [`micro-avoid-bounds-checks-in-hot-loops`](references\u002Fmicro-avoid-bounds-checks-in-hot-loops.md) - Avoid bounds checks in hot loops\n- [`micro-use-wrapping-arithmetic-when-safe`](references\u002Fmicro-use-wrapping-arithmetic-when-safe.md) - Use wrapping arithmetic when safe\n- [`micro-use-byte-literals-for-ascii`](references\u002Fmicro-use-byte-literals-for-ascii.md) - Use byte literals for ASCII\n\n## References\n\n1. [https:\u002F\u002Fnnethercote.github.io\u002Fperf-book\u002F](https:\u002F\u002Fnnethercote.github.io\u002Fperf-book\u002F)\n2. [https:\u002F\u002Frust-lang.github.io\u002Fapi-guidelines\u002F](https:\u002F\u002Frust-lang.github.io\u002Fapi-guidelines\u002F)\n3. [https:\u002F\u002Fdoc.rust-lang.org\u002Fnomicon\u002F](https:\u002F\u002Fdoc.rust-lang.org\u002Fnomicon\u002F)\n4. [https:\u002F\u002Ftokio.rs\u002Ftokio\u002Ftutorial](https:\u002F\u002Ftokio.rs\u002Ftokio\u002Ftutorial)\n\n## Related Skills\n\n- For idiomatic patterns, architecture, and code organization, see `rust-refactor` skill\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fpproenca\u002Fdot-skills\u002Frust-optimise",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill rust-optimise",{"tool":39,"command":40},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill rust-optimise",{"tool":42,"command":43},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill rust-optimise","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fpproenca\u002Fdot-skills\u002Frust-optimise\u002FSKILL.md",true,[],[48,62,72,81,87,94],{"skillNo":49,"name":50,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":58,"publishedAt":20},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[53],{"categoryNo":54,"categoryName":55,"taxonomyType":56,"taxonomyTypeDesc":57},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[59,60,61],"model","model hierarchy","model hierarchy skill",{"skillNo":63,"name":64,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":68,"publishedAt":20},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[67],{"categoryNo":54,"categoryName":55,"taxonomyType":56,"taxonomyTypeDesc":57},[69,70,71],"MCP","zoom","zoom mcp",{"skillNo":73,"name":74,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":20},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[78,79,80,70],"sdk","zoom apps sdk","apps",{"skillNo":82,"name":83,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":20},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[83],{"skillNo":88,"name":89,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":93,"publishedAt":20},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[92],{"categoryNo":54,"categoryName":55,"taxonomyType":56,"taxonomyTypeDesc":57},[89],{"skillNo":95,"name":96,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":20},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[96]]