ios-performance-engineeringlisted
Install: claude install-skill wei18/apple-dev-skills
# iOS Performance Engineering
## When to invoke
- Diagnosing UI slowness, scroll hitches, or app hangs.
- Investigating high memory usage, leaks, or large binary size.
- Wiring MetricKit to receive field performance data from real devices.
- Setting up `XCTMetric` / `measure {}` baselines in CI.
- Deciding whether to move work off `@MainActor` and how to do it safely.
- Evaluating launch time before a release.
## Instruments — the primary measurement tool
Never guess at a performance problem; profile first. Instruments ships with Xcode.
| Symptom | Instrument / template | Metric to read |
|---|---|---|
| High CPU / slow interactive path | Time Profiler | inverted call tree, self time > 5 ms on main thread |
| Unbounded memory growth | Allocations (Generation) | allocations that grow across repeated actions |
| Scroll / animation stutter | Animation Hitches | `hitch rate` (ms of hitch per second) |
| Main-thread freeze / spin | Hangs | block duration ≥ 250 ms |
| Slow cold launch | App Launch | time to first committed frame |
| Excessive SwiftUI re-renders | SwiftUI instrument | body invocation count, triggering property |
Key templates, condensed (full walkthrough of each template's UI: `references/instruments-templates.md`):
- **Time Profiler**: a function taking >5 ms on the main thread in an interactive path is a candidate for offloading.
- **Allocations**: the "Leaks" instrument detects reference cycles automatically but misses logical leaks (objects kept alive lon