dimitriremoiville/cc-mobile/ios-performance
Claude Code and agent skill by dimitriremoiville/cc-mobile
- community
Checking that the SKILL.md file is still in the repository.
iOS performance discipline for this project — measure-before-optimize, launch-time budget, SwiftUI body-invalidation debugging, scroll smoothness, Signposts and MetricKit wiring, and the Instruments pass for a regression. Load when investigating jank, cold-start regressions, hangs, or memory growth.
Install
npx vskill@latest install dimitriremoiville/cc-mobile/ios-performanceSKILL.md
The same SKILL.md was published earlier as dimitriremoiville/cc-mobile/ios-performance.
iOS performance
When this applies
Largely stack-agnostic. Instruments, Signposts, MetricKit, and the launch-time rules work for any iOS app regardless of architecture. The SwiftUI subsections (body invalidation, Self._printChanges(), @Observable tracking) apply only where SwiftUI is in use — for UIKit screens, apply the same measurement discipline with the View-system tools (CADisplayLink frame timing, Hangs and Time Profiler instruments).
Measure first
A performance claim without a trace is an opinion. Every optimization in this repo carries a before/after number from Instruments, a MetricKit payload, or a Signpost interval.
Record on a release build. Debug builds carry unoptimized Swift, dylib validation, and no cross-module optimization — a Debug profile tells you almost nothing about what ships.
Launch time
Everything synchronous in app init and didFinishLaunching delays the first frame.
- Move analytics, logging, Firebase, and remote-config initialisation off the critical path — after the first scene, or into a low-priority task.
- Measure TTI (time to interactive), not just TTFF (time to first frame). TTFF hides a spinner-only first screen.
- Pre-main cost (dylib loading, ObjC
+load) shows in the App Launch template. It is dominated by dynamically linked dependencies: prefer static linking for SPM packages in the main target, and cut dependencies the app doesn't use at launch.
SwiftUI body invalidation
@Observable tracks per-property access, so a view that reads model.title re-evaluates only when title changes. That's the mechanism most "SwiftUI is slow" reports are actually missing.
When a body evaluates more than expected:
Then fix the cause, in this order:
- The view holds too much. Pass the slice a subview needs, not the whole model.
- Derived values computed in `body`. Compute them in the view model.
- A closure or non-`Equatable` value recreated per render, defeating structural identity.
Scroll smoothness
- `List` or `LazyVStack` past ~50 rows.
ForEachinside a plainScrollViewbuilds every row. - A cell's `body` must be cheap. Formatting, date math, and string building belong in the view model, precomputed.
- No `GeometryReader` inside a cell. It invalidates per frame and reliably tanks scroll.
- Stable identity matters: a real
id, never\.selfon a value whose equality is expensive or surprising. .drawingGroup()for complex paths and effects that otherwise re-render every frame — measure, it isn't free.
Memory
- Images dominate.
UIImage(named:)populates a system cache that isn't yours to evict;UIImage(contentsOfFile:)doesn't. Downsample before display — a 4000px image in a 200pt view costs the full decoded bitmap. - Data over ~1MB goes through a stream, not a
Datain memory. - Allocations for steady-state growth, Leaks for cycles. A Combine subscription stored on
selfwithout a matching teardown leaks quietly and never shows as a crash. - Prefer
.task { }over a storedTaskso lifetime is tied to the view rather than to a[weak self]dance.
Signposts
Custom intervals show up in Instruments' Points of Interest lane and are the cheapest way to time your own code in a real trace:
Names become column headers — keep them short and stable across builds so traces stay comparable.
MetricKit
Production telemetry: launch times, hang rate, CPU and energy, plus diagnostic payloads for crashes and hangs, delivered daily per device.
This is the only source of truth for how the app behaves on the devices people actually own. Ship the payloads to your analytics pipeline; a subscriber that logs and discards is wasted wiring.
The regression pass
In order, on a release build:
- Hangs — where did the main thread block for >250ms.
- Time Profiler — what's eating CPU.
- Allocations — unexpected growth or a large steady-state heap.
- Leaks — retain cycles.
- SwiftUI — body counts and rendering hitches.
Hard nos
- No optimization without a before/after measurement.
- No profiling a Debug build and reporting the number.
- No `@State` for values that outlive the view.
- No `onAppear { Task { } }` where
.task { }is the right tool — it leaks the task past view lifetime. - No heavy logging in release,
print()included.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingios/.claude/skills/ios-performance/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dimitriremoiville/cc-mobile/ios-performance)