[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ES7T7FQ8HRNX576PANNETA":3,"skill-same:01M6ES7T7FQ8HRNX576PANNETA":107},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":57,"repositoryHtmlUrl":58,"repositoryHomepageUrl":59,"ownerHtmlUrl":60,"ownerBlogUrl":6,"ownerDescription":61,"updatedAt":62,"install":63,"resources":76},"01M6ES7T7FQ8HRNX576PANNETA","swiftui-performance-audit",null,"Audit and improve SwiftUI runtime performance from code review and architecture. Use for requests to diagnose slow rendering, janky scrolling, high CPU\u002Fmemory usage, excessive view updates, or layout thrash in SwiftUI apps, and to provide guidance for user-run Instruments profiling when code review alone is insufficient.","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\u002Faiskillstore\u002Fmarketplace\u002Fdimillian\u002Fswiftui-performance-audit\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000007","代码审查","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"performance","swiftui performance audit","audit","swiftui","improve","rendering","CPU","apps","runtime","layout","instruments profiling","use","view","code review","code","run","diagnose","architecture","memory","review","2026-11-10 10:12:30",false,"---\nname: swiftui-performance-audit\ndescription: Audit and improve SwiftUI runtime performance from code review and architecture. Use for requests to diagnose slow rendering, janky scrolling, high CPU\u002Fmemory usage, excessive view updates, or layout thrash in SwiftUI apps, and to provide guidance for user-run Instruments profiling when code review alone is insufficient.\n---\n\n# SwiftUI Performance Audit\n\n## Overview\n\nAudit SwiftUI view performance end-to-end, from instrumentation and baselining to root-cause analysis and concrete remediation steps.\n\n## Workflow Decision Tree\n\n- If the user provides code, start with \"Code-First Review.\"\n- If the user only describes symptoms, ask for minimal code\u002Fcontext, then do \"Code-First Review.\"\n- If code review is inconclusive, go to \"Guide the User to Profile\" and ask for a trace or screenshots.\n\n## 1. Code-First Review\n\nCollect:\n- Target view\u002Ffeature code.\n- Data flow: state, environment, observable models.\n- Symptoms and reproduction steps.\n\nFocus on:\n- View invalidation storms from broad state changes.\n- Unstable identity in lists (`id` churn, `UUID()` per render).\n- Heavy work in `body` (formatting, sorting, image decoding).\n- Layout thrash (deep stacks, `GeometryReader`, preference chains).\n- Large images without downsampling or resizing.\n- Over-animated hierarchies (implicit animations on large trees).\n\nProvide:\n- Likely root causes with code references.\n- Suggested fixes and refactors.\n- If needed, a minimal repro or instrumentation suggestion.\n\n## 2. Guide the User to Profile\n\nExplain how to collect data with Instruments:\n- Use the SwiftUI template in Instruments (Release build).\n- Reproduce the exact interaction (scroll, navigation, animation).\n- Capture SwiftUI timeline and Time Profiler.\n- Export or screenshot the relevant lanes and the call tree.\n\nAsk for:\n- Trace export or screenshots of SwiftUI lanes + Time Profiler call tree.\n- Device\u002FOS\u002Fbuild configuration.\n\n## 3. Analyze and Diagnose\n\nPrioritize likely SwiftUI culprits:\n- View invalidation storms from broad state changes.\n- Unstable identity in lists (`id` churn, `UUID()` per render).\n- Heavy work in `body` (formatting, sorting, image decoding).\n- Layout thrash (deep stacks, `GeometryReader`, preference chains).\n- Large images without downsampling or resizing.\n- Over-animated hierarchies (implicit animations on large trees).\n\nSummarize findings with evidence from traces\u002Flogs.\n\n## 4. Remediate\n\nApply targeted fixes:\n- Narrow state scope (`@State`\u002F`@Observable` closer to leaf views).\n- Stabilize identities for `ForEach` and lists.\n- Move heavy work out of `body` (precompute, cache, `@State`).\n- Use `equatable()` or value wrappers for expensive subtrees.\n- Downsample images before rendering.\n- Reduce layout complexity or use fixed sizing where possible.\n\n## Common Code Smells (and Fixes)\n\nLook for these patterns during code review.\n\n### Expensive formatters in `body`\n\n```swift\nvar body: some View {\n    let number = NumberFormatter() \u002F\u002F slow allocation\n    let measure = MeasurementFormatter() \u002F\u002F slow allocation\n    Text(measure.string(from: .init(value: meters, unit: .meters)))\n}\n```\n\nPrefer cached formatters in a model or a dedicated helper:\n\n```swift\nfinal class DistanceFormatter {\n    static let shared = DistanceFormatter()\n    let number = NumberFormatter()\n    let measure = MeasurementFormatter()\n}\n```\n\n### Computed properties that do heavy work\n\n```swift\nvar filtered: [Item] {\n    items.filter { $0.isEnabled } \u002F\u002F runs on every body eval\n}\n```\n\nPrefer precompute or cache on change:\n\n```swift\n@State private var filtered: [Item] = []\n\u002F\u002F update filtered when inputs change\n```\n\n### Sorting\u002Ffiltering in `body` or `ForEach`\n\n```swift\nList {\n    ForEach(items.sorted(by: sortRule)) { item in\n        Row(item)\n    }\n}\n```\n\nPrefer sort once before view updates:\n\n```swift\nlet sortedItems = items.sorted(by: sortRule)\n```\n\n### Inline filtering in `ForEach`\n\n```swift\nForEach(items.filter { $0.isEnabled }) { item in\n    Row(item)\n}\n```\n\nPrefer a prefiltered collection with stable identity.\n\n### Unstable identity\n\n```swift\nForEach(items, id: \\.self) { item in\n    Row(item)\n}\n```\n\nAvoid `id: \\.self` for non-stable values; use a stable ID.\n\n### Image decoding on the main thread\n\n```swift\nImage(uiImage: UIImage(data: data)!)\n```\n\nPrefer decode\u002Fdownsample off the main thread and store the result.\n\n### Broad dependencies in observable models\n\n```swift\n@Observable class Model {\n    var items: [Item] = []\n}\n\nvar body: some View {\n    Row(isFavorite: model.items.contains(item))\n}\n```\n\nPrefer granular view models or per-item state to reduce update fan-out.\n\n## 5. Verify\n\nAsk the user to re-run the same capture and compare with baseline metrics.\nSummarize the delta (CPU, frame drops, memory peak) if provided.\n\n## Outputs\n\nProvide:\n- A short metrics table (before\u002Fafter if available).\n- Top issues (ordered by impact).\n- Proposed fixes with estimated effort.\n\n## References\n\nAdd Apple documentation and WWDC resources under `references\u002F` as they are supplied by the user.\n- Optimizing SwiftUI performance with Instruments: `references\u002Foptimizing-swiftui-performance-instruments.md`\n- Understanding and improving SwiftUI performance: `references\u002Funderstanding-improving-swiftui-performance.md`\n- Understanding hangs in your app: `references\u002Funderstanding-hangs-in-your-app.md`\n- Demystify SwiftUI performance (WWDC23): `references\u002Fdemystify-swiftui-performance-wwdc23.md`\n","# SwiftUI Performance Audit\n\n## Overview\n\nAudit SwiftUI view performance end-to-end, from instrumentation and baselining to root-cause analysis and concrete remediation steps.\n\n## Workflow Decision Tree\n\n- If the user provides code, start with \"Code-First Review.\"\n- If the user only describes symptoms, ask for minimal code\u002Fcontext, then do \"Code-First Review.\"\n- If code review is inconclusive, go to \"Guide the User to Profile\" and ask for a trace or screenshots.\n\n## 1. Code-First Review\n\nCollect:\n- Target view\u002Ffeature code.\n- Data flow: state, environment, observable models.\n- Symptoms and reproduction steps.\n\nFocus on:\n- View invalidation storms from broad state changes.\n- Unstable identity in lists (`id` churn, `UUID()` per render).\n- Heavy work in `body` (formatting, sorting, image decoding).\n- Layout thrash (deep stacks, `GeometryReader`, preference chains).\n- Large images without downsampling or resizing.\n- Over-animated hierarchies (implicit animations on large trees).\n\nProvide:\n- Likely root causes with code references.\n- Suggested fixes and refactors.\n- If needed, a minimal repro or instrumentation suggestion.\n\n## 2. Guide the User to Profile\n\nExplain how to collect data with Instruments:\n- Use the SwiftUI template in Instruments (Release build).\n- Reproduce the exact interaction (scroll, navigation, animation).\n- Capture SwiftUI timeline and Time Profiler.\n- Export or screenshot the relevant lanes and the call tree.\n\nAsk for:\n- Trace export or screenshots of SwiftUI lanes + Time Profiler call tree.\n- Device\u002FOS\u002Fbuild configuration.\n\n## 3. Analyze and Diagnose\n\nPrioritize likely SwiftUI culprits:\n- View invalidation storms from broad state changes.\n- Unstable identity in lists (`id` churn, `UUID()` per render).\n- Heavy work in `body` (formatting, sorting, image decoding).\n- Layout thrash (deep stacks, `GeometryReader`, preference chains).\n- Large images without downsampling or resizing.\n- Over-animated hierarchies (implicit animations on large trees).\n\nSummarize findings with evidence from traces\u002Flogs.\n\n## 4. Remediate\n\nApply targeted fixes:\n- Narrow state scope (`@State`\u002F`@Observable` closer to leaf views).\n- Stabilize identities for `ForEach` and lists.\n- Move heavy work out of `body` (precompute, cache, `@State`).\n- Use `equatable()` or value wrappers for expensive subtrees.\n- Downsample images before rendering.\n- Reduce layout complexity or use fixed sizing where possible.\n\n## Common Code Smells (and Fixes)\n\nLook for these patterns during code review.\n\n### Expensive formatters in `body`\n\n```swift\nvar body: some View {\n    let number = NumberFormatter() \u002F\u002F slow allocation\n    let measure = MeasurementFormatter() \u002F\u002F slow allocation\n    Text(measure.string(from: .init(value: meters, unit: .meters)))\n}\n```\n\nPrefer cached formatters in a model or a dedicated helper:\n\n```swift\nfinal class DistanceFormatter {\n    static let shared = DistanceFormatter()\n    let number = NumberFormatter()\n    let measure = MeasurementFormatter()\n}\n```\n\n### Computed properties that do heavy work\n\n```swift\nvar filtered: [Item] {\n    items.filter { $0.isEnabled } \u002F\u002F runs on every body eval\n}\n```\n\nPrefer precompute or cache on change:\n\n```swift\n@State private var filtered: [Item] = []\n\u002F\u002F update filtered when inputs change\n```\n\n### Sorting\u002Ffiltering in `body` or `ForEach`\n\n```swift\nList {\n    ForEach(items.sorted(by: sortRule)) { item in\n        Row(item)\n    }\n}\n```\n\nPrefer sort once before view updates:\n\n```swift\nlet sortedItems = items.sorted(by: sortRule)\n```\n\n### Inline filtering in `ForEach`\n\n```swift\nForEach(items.filter { $0.isEnabled }) { item in\n    Row(item)\n}\n```\n\nPrefer a prefiltered collection with stable identity.\n\n### Unstable identity\n\n```swift\nForEach(items, id: \\.self) { item in\n    Row(item)\n}\n```\n\nAvoid `id: \\.self` for non-stable values; use a stable ID.\n\n### Image decoding on the main thread\n\n```swift\nImage(uiImage: UIImage(data: data)!)\n```\n\nPrefer decode\u002Fdownsample off the main thread and store the result.\n\n### Broad dependencies in observable models\n\n```swift\n@Observable class Model {\n    var items: [Item] = []\n}\n\nvar body: some View {\n    Row(isFavorite: model.items.contains(item))\n}\n```\n\nPrefer granular view models or per-item state to reduce update fan-out.\n\n## 5. Verify\n\nAsk the user to re-run the same capture and compare with baseline metrics.\nSummarize the delta (CPU, frame drops, memory peak) if provided.\n\n## Outputs\n\nProvide:\n- A short metrics table (before\u002Fafter if available).\n- Top issues (ordered by impact).\n- Proposed fixes with estimated effort.\n\n## References\n\nAdd Apple documentation and WWDC resources under `references\u002F` as they are supplied by the user.\n- Optimizing SwiftUI performance with Instruments: `references\u002Foptimizing-swiftui-performance-instruments.md`\n- Understanding and improving SwiftUI performance: `references\u002Funderstanding-improving-swiftui-performance.md`\n- Understanding hangs in your app: `references\u002Funderstanding-hangs-in-your-app.md`\n- Demystify SwiftUI performance (WWDC23): `references\u002Fdemystify-swiftui-performance-wwdc23.md`\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002Fdimillian\u002Fswiftui-performance-audit",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":8,"skillName":5,"commands":64,"prompt":74,"zipAvailable":75},[65,68,71],{"tool":66,"command":67},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill swiftui-performance-audit",{"tool":69,"command":70},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill swiftui-performance-audit",{"tool":72,"command":73},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill swiftui-performance-audit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fdimillian\u002Fswiftui-performance-audit\u002FSKILL.md",true,[77,83,87,91,95,99,103],{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fcustom-ui.md","REFERENCE","参考文档",11340,"https:\u002F\u002Fgithub.com\u002FAkaraChen\u002Fangel-engine\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fthread-list\u002Freferences\u002Fcustom-ui.md",{"path":84,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fdemystify-swiftui-performance-wwdc23.md",1813,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fdimillian\u002Fswiftui-performance-audit\u002Freferences\u002Fdemystify-swiftui-performance-wwdc23.md",{"path":88,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fmanagement.md",5861,"https:\u002F\u002Fgithub.com\u002FAkaraChen\u002Fangel-engine\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fthread-list\u002Freferences\u002Fmanagement.md",{"path":92,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Foptimizing-swiftui-performance-instruments.md",1837,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fdimillian\u002Fswiftui-performance-audit\u002Freferences\u002Foptimizing-swiftui-performance-instruments.md",{"path":96,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Funderstanding-hangs-in-your-app.md",1267,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fdimillian\u002Fswiftui-performance-audit\u002Freferences\u002Funderstanding-hangs-in-your-app.md",{"path":100,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":101,"sourceHtmlUrl":102},"references\u002Funderstanding-improving-swiftui-performance.md",2262,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fdimillian\u002Fswiftui-performance-audit\u002Freferences\u002Funderstanding-improving-swiftui-performance.md",{"path":104,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":105,"sourceHtmlUrl":106},"skill-report.json",17783,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fdimillian\u002Fswiftui-performance-audit\u002Fskill-report.json",[108,120,130,138,144,151],{"skillNo":109,"name":110,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":116,"publishedAt":49},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[113],{"categoryNo":114,"categoryName":115,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[117,118,119],"model","model hierarchy","model hierarchy skill",{"skillNo":121,"name":122,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":126,"publishedAt":49},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[125],{"categoryNo":114,"categoryName":115,"taxonomyType":21,"taxonomyTypeDesc":22},[127,128,129],"MCP","zoom","zoom mcp",{"skillNo":131,"name":132,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":49},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[136,137,36,128],"sdk","zoom apps sdk",{"skillNo":139,"name":140,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":49},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[140],{"skillNo":145,"name":146,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":150,"publishedAt":49},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[149],{"categoryNo":114,"categoryName":115,"taxonomyType":21,"taxonomyTypeDesc":22},[146],{"skillNo":152,"name":153,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":49},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[153]]