/axiom:audit-swiftui-performance
Scan SwiftUI code for performance anti-patterns that cause frame drops (launches swiftui-performance-analyzer agent).
Command
bash
/axiom:audit-swiftui-performanceWhat It Checks
Critical Impact (Frame Drops)
- File I/O in body: Blocking the main thread during render
- Heavy Initialization: Creating
DateFormatterorNumberFormatterinside view body
High Impact
- Image Processing: Resizing/filtering images inside the body (should be backgrounded)
- Collection Dependencies: Using
.counton large collections instead of stable IDs
Medium Impact
- Lazy Loading: Missing
LazyVStack/LazyHStackin scroll views - Environment Churn: Frequently changing environment values triggering redraws
- View Identity: Implicit
AnyViewusage breaking diffing
When to Use
- Scrolling is janky or stutters
- Animations drop frames
- View updates feel sluggish
- Device gets hot during simple usage
Related
- /axiom:audit-swiftui-nav - Check navigation correctness
- swiftui-performance - Optimization guide