Install
$ agentstack add skill-markdavidgan-apple-dev-skills-performance-instruments ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Performance & Instruments
Measure first, then fix the thing the measurement points at. Guessing at performance wastes days. Pair with ios-test (perf tests) and ios-standards (concurrency).
> Rule: never optimize without a profile. A 2-line fix at the real hot spot beats a week of speculative micro-optimization elsewhere.
Pick the right instrument
| Problem | Instrument / tool | |---------|-------------------| | CPU hot spots, "where is time going" | Time Profiler | | App launch breakdown | App Launch template | | Main-thread stalls (UI freezes) | Hangs / Thread State | | Dropped frames while scrolling/animating | Animation Hitches / SwiftUI | | Memory growth, abandoned memory | Allocations + Leaks + Memory Graph | | Battery / wakeups / networking | Energy Log, Points of Interest | | Real-world data from users | MetricKit (MXMetricManager) |
Profile a Release/optimized build on a real device — Debug builds and the simulator lie about performance.
Launch time (the first impression)
Target ~250ms (user sees a freeze). A hitch** = a frame misses its deadline (stutter). On ProMotion (120Hz) the per-frame budget is ~8ms, so hitches are easier to hit.
- Get work off the main thread. Heavy decoding, file I/O, image resizing, JSON parsing → background (an
actororTask.detached), then hop back to@MainActorfor UI only. Seeios-standards. - Don't block on
awaitof slow work inside view updates. Load asynchronously and render a placeholder. - In lists: pre-size rows, avoid synchronous image decode, use lazy stacks/
Listrecycling. - The Hangs instrument (and Xcode's runtime "Hang" warnings) pinpoint the blocking call stack.
Memory
- Leaks (cycles): the usual culprit is a closure capturing
selfstrongly. Use[weak self]in escaping closures, delegates, andTasks that outlive the view. The Memory Graph Debugger (Xcode → Debug Memory Graph) shows retain cycles visually; Leaks flags them live. - Abandoned memory / growth: Allocations with "Mark Generation" — repeat an action, mark, and see what never frees. Caches without limits are a classic.
- Respond to memory pressure; don't cache unbounded. Large images: downsample to display size before keeping them.
MetricKit — performance from real users
Instruments shows your device; MetricKit shows the field.
import MetricKit
final class Metrics: NSObject, MXMetricManagerSubscriber {
func didReceive(_ payloads: [MXMetricPayload]) { /* launch, hang, hitch, memory, disk, energy */ }
func didReceive(_ payloads: [MXDiagnosticPayload]) { /* crash, hang, CPU-exception diagnostics */ }
}
// MXMetricManager.shared.add(subscriber)
Payloads arrive ~once/day. Aggregate applicationLaunchMetrics, applicationHangTime, animationMetrics (hitch ratio), and memoryMetrics to catch regressions you'd never reproduce locally. Feed these into your analytics (see app-analytics).
Workflow (/perf-audit)
- Reproduce the complaint on a real device, Release build.
- Pick the instrument for the symptom (table above) and capture a trace.
- Find the single biggest contributor; fix it; re-measure to confirm the win.
- Add a signpost or perf test (
ios-test) so the regression can't silently return. - Check MetricKit trends after release to verify the fix holds in the field.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: markdavidgan
- Source: markdavidgan/apple-dev-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.