swiftui-performance-audit

Diagnose SwiftUI rendering, scrolling, and update performance issues from code and profiling evidence.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/AarnavBaddam/skills --skill swiftui-performance-audit-aarnavbaddam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-performance-audit
Source: https://github.com/AarnavBaddam/skills/tree/main/swiftui-performance-audit
Command: npx skills add https://github.com/AarnavBaddam/skills --skill swiftui-performance-audit-aarnavbaddam

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? SwiftUI apps often suffer from slow rendering, janky scrolling, hangs, and excessive view updates that are hard to trace. This Skill provides a structured audit workflow that starts with code review and escalates to Instruments profiling only when needed. ## Core Features & Use Cases - Code-first review: Detects common performance smells such as expensive formatters in body, unstable ForEach identity, observation fan-out, and main-thread image decoding. - Guided profiling intake: Provides a checklist for capturing SwiftUI Instrument traces, Time Profiler call trees, and hang data with the right device and build configuration. - Structured audit reports: Summarizes findings by impact with symptoms, evidence, fixes, and before/after metrics using a consistent template. - Use Case: A user reports dropped frames while scrolling a list. The Skill reviews the view code, finds inline filtering inside ForEach and unstable identity, recommends pre-filtering with stable IDs, and asks for a Release-mode trace to verify the fix. ## Quick Start Use the swiftui-performance-audit skill to review this SwiftUI view for performance problems and suggest concrete fixes.

Frequently Asked Questions about swiftui-performance-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I diagnose slow SwiftUI view rendering?

Start with a code-first review looking for expensive work in body such as formatters, sorting, and filtering. If code review is inconclusive, capture a Release-mode trace with the SwiftUI Instruments template and inspect Long View Body Updates correlated with Time Profiler.

How to fix janky scrolling in SwiftUI lists?

Janky scrolling usually comes from unstable ForEach identity, inline filtering, or heavy row bodies. Use stable domain identifiers instead of id: \.self, pre-filter collections before rendering, and move expensive computation out of the row body.

Why does @Observable cause too many SwiftUI view updates?

Broad @Observable reads cause update fan-out when many views observe the same large model or collection. Narrow the observable surface, use per-item view models, and scope state closer to the leaf views that actually read it.

Should I profile SwiftUI performance in Debug or Release builds?

Profile in Release builds whenever possible because Debug builds distort SwiftUI timing and allocation behavior. Also prefer a real device over the Simulator, since Simulator traces can miss device-only rendering and memory issues.

When should I use equatable() in SwiftUI views?

Use equatable() only when equality checking is cheaper than recomputing the subtree and the view inputs are value-semantic and stable. It is not a blanket fix for all redraws and can add overhead if misapplied.