performance-profiling
Skill915 starsChanged 22 days agoMITView on GitHub
Guide performance profiling with Instruments, diagnose hangs, memory issues, slow launches, and energy drain. Use when reviewing app performance or investigating specific bottlenecks.
37 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- gromov0737/skillstheir own version, first seen Nov 29, 2026
- AutisticAF/claude-code-apple-dev-pluginedited, first seen Nov 29, 2026
- afine907/skillstheir own version, first seen Nov 29, 2026
- camilooscargbaptista/cto-toolkittheir own version, first seen Nov 29, 2026
- swadhinbiswas/SKILLStheir own version, first seen Nov 22, 2026
- XData-si/xdata-agenthubtheir own version, first seen Nov 22, 2026
Used with
Projects with it also use intelligent-routing, red-team-tactics and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SKB3002Skillintelligent-routing
Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.
Also in 5 projects that use this
xenitV1Skillred-team-tactics
Red team tactics principles based on MITRE ATT&CK. Attack phases, detection evasion, reporting.
Also in 7 projects that use this
SKB3002Skillnextjs-react-expert
React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.
Also in 3 projects that use this
xenitV1Skillbash-linux
Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems.
Also in 7 projects that use this
MicrosoftSkillapp-builder
Builds and edits a model-driven Power Apps app from a natural-language intent — tables, columns, relationships, adaptive forms with sub-grids, views, Choice-column charts, business rules, business process flows, generative page intents for overview/dashboard surfaces, and an app module + sitemap. Runs an interactive authoring flow with plan approval and can download a deployed app back into an editable spec to change it. Use when the user says "build an app for X", "create a model-driven app", "make me an app to manage Y", "add a business process flow", or "edit/add to my app". Do not use it for a generic web or React app or website, Power Pages, canvas apps, or Power Automate, or when the user rules out Power Platform, Dataverse, or model-driven apps (for example "no Power Platform"). This skill stands alone and does not require /genpage — but for a standalone generative page added to an app that already exists, use /genpage instead.
Also in 5 projects that use this
- +7 more from xenitV1
Other versions37 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- AutisticAF/claude-code-apple-dev-plugin★ 682% same
- vaferkhanom/Website-skills★ 423% same
Wrote their own version · 35
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- LiberatedPixelCup/Universal-LPC-Spritesheet-Character-Generator★ 2.1ksame name
- conorluddy/xclaude-plugin★ 186same name
- xenitV1/Antigravity-Workflows★ 130same name
- HeshamFS/materials-simulation-skills★ 95same name
- nahid-sparktales/agent-dispatcher★ 59same name
- VoDaiLocz/kilo-kit-mcp★ 27same name
- ChariereFiedler/ronce-racine★ 11same name
- camilooscargbaptista/cto-toolkit★ 9same name
25 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository184 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- app-intentsSkill
- foundation-modelsSkill
- apple-intelligenceSkill
- visual-intelligenceSkill
- ad-attributionSkill
- app-description-writerSkill
- apple-search-adsSkill
- iap-finalizerSkill
- keyword-optimizerSkill
- marketing-strategySkill
- originality-checkSkill
- ratings-mechanicsSkill
- rejection-handlerSkill
- review-response-writerSkill
- screenshot-plannerSkill
- app-storeSkill
- web-presenceSkill
- core-mlSkill
- animation-patternsSkill
- design-systemSkill
- game-feelSkill
- liquid-glassSkill
- sf-symbolsSkill
- designSkill
- typographySkill
- ui-prototypingSkill
- ux-writingSkill
- attributed-stringSkill
- foundationSkill
- accessibility-generatorSkill
- account-deletionSkill
- analytics-setupSkill
- announcement-bannerSkill
- app-clipSkill
- app-extensionsSkill
- app-icon-generatorSkill
- app-store-assetsSkill
- auth-flowSkill
- background-processingSkill
- ci-cd-setupSkill
- cloudkit-syncSkill
- consent-flowSkill
- custom-product-pagesSkill
- data-exportSkill
- debug-menuSkill
- deep-linkingSkill
- error-monitoringSkill
- feature-flagsSkill
- featuring-nominationSkill
- feedback-formSkill
- force-updateSkill
- http-cacheSkill
- image-loadingSkill
- in-app-eventsSkill
- lapsed-userSkill
- live-activity-generatorSkill
- localization-setupSkill
- logging-setupSkill
- milestone-celebrationSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 21 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Use this skill when the user:
- Distinctive: line 88
Ask the user or inspect their description to classify the issue:
- Distinctive: line 106
Use Release build configuration (optimizations change behavior)
- Very specific: line 115
Add os_signpost markers for ongoing monitoring
“Common” is measured: kept by at least 6 in 10 of the 21 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Performance Profiling
Systematic guide for profiling Apple platform apps using Instruments, Xcode diagnostics, and MetricKit. Covers CPU, memory, launch time, and energy analysis with actionable fix patterns.
When This Skill Activates
Use this skill when the user:
- Reports app hangs, stutters, or dropped frames
- Needs to profile CPU usage or find hot code paths
- Has memory leaks, high memory usage, or OOM crashes
- Wants to optimize app launch time
- Needs to reduce battery/energy impact
- Asks about Instruments, Time Profiler, Allocations, or Leaks
- Wants to add
os_signpostor performance measurement to code - Is preparing for App Store review and needs performance validation
Decision Tree
What performance problem are you investigating?
│
├─ App hangs / unresponsive to taps / slow UI
│ └─ Read time-profiler.md
│
├─ Scroll or animation stutter / dropped frames / hitches
│ └─ Read hitches.md
│
├─ High memory / leaks / OOM crashes / growing footprint
│ └─ Read memory-profiling.md
│
├─ Slow app launch / time to first frame
│ └─ Read launch-optimization.md
│
├─ Battery drain / thermal throttling / background energy
│ └─ Read energy-diagnostics.md
│
├─ General "app feels slow" (unknown cause)
│ └─ Start with time-profiler.md, then memory-profiling.md
│
└─ Pre-release performance audit
└─ Read ALL reference files, use Review Checklist belowQuick Reference
| Problem | Instrument / Tool | Key Metric | Reference |
| UI hangs > 250ms | Time Profiler + Hangs | Hang duration, main thread stack | time-profiler.md |
| Scroll/animation hitches | Animation Hitches template | Hitch time ratio (< 5 ms/s good, > 10 critical) | hitches.md |
| High CPU usage | Time Profiler / CPU Profiler | CPU % by function, call tree weight | time-profiler.md |
| Memory leak | Leaks + Memory Graph | Leaked bytes, retain cycle paths | memory-profiling.md |
| Memory growth | Allocations | Live bytes, generation analysis | memory-profiling.md |
| Slow launch | App Launch | Time to first frame (pre-main + post-main) | launch-optimization.md |
| Battery drain | Energy Log / Power Profiler | Energy Impact score, CPU/GPU/network | energy-diagnostics.md |
| Thermal issues | Activity Monitor | Thermal state transitions | energy-diagnostics.md |
| Network waste | Network profiler | Redundant fetches, large payloads | energy-diagnostics.md |
The 8 Key Metrics (WWDC21 10181)
Apple enumerates exactly eight things to track for app performance, all coverable with five tools (Xcode Organizer, MetricKit, Instruments, XCTest, App Store Connect API):
| # | Metric | Threshold / signal | Tool |
| 1 | Battery usage | Energy Gauge flags CPU use > 20% as High CPU, plus CPU Wake Overhead regions; top subsystems to watch: CPU, Networking, Location | Energy Gauge → Time Profiler |
| 2 | Launch time | Time between icon tap and first frame rendered | App Launch template, XCTApplicationLaunchMetric |
| 3 | Hang rate | Unresponsive to input for ≥ 250ms | Hangs instrument, Organizer |
| 4 | Memory | Organizer charts peak memory and memory at suspension; a spike with no termination spike yet is your early warning | Allocations, Leaks, VM Tracker |
| 5 | Disk writes | Exception report when the app writes > 1 GB in 24 hours (with stack trace + Insights annotations) | File Activity template, XCTStorageMetric |
| 6 | Scrolling | Red bars in the Organizer scrolling chart = poor scroll experience, fix immediately | Animation Hitches, XCTOSSignpostMetric.scrollDecelerationMetric |
| 7 | Terminations | Every termination forces a slow cold launch next time and loses user state | MXAppExitMetric, Organizer |
| 8 | MXSignposts | Custom marked intervals for your critical code sections | MetricKit |
The Organizer aggregates all of these from consented user devices across the last 16 app versions; the Regressions pane (Xcode 13) isolates every metric that increased significantly in the most recent version, in one place. The same data is available as JSON via the App Store Connect API (WWDC21 10181).
Process
1. Identify the Problem Category
Ask the user or inspect their description to classify the issue:
- Responsiveness: Hangs, stutters, animation drops
- Memory: Leaks, growth, OOM crashes
- Launch: Slow cold/warm start
- Energy: Battery drain, thermal throttling
2. Read the Appropriate Reference File
Each file contains:
- Which Instruments template to use
- Step-by-step profiling workflow
- How to interpret results
- Common fix patterns with code examples
3. Profile on Real Hardware
Always remind users:
- Profile on device, not Simulator (Simulator uses host CPU/memory)
- Use Release build configuration (optimizations change behavior)
- Profile with representative data (empty databases hide real perf)
- Close other apps to reduce noise
4. Apply Fixes and Verify
After identifying bottlenecks:
- Apply targeted fix from the reference file
- Re-profile to confirm improvement
- Add
os_signpostmarkers for ongoing monitoring
Xcode Diagnostic Settings
Recommend enabling these in Scheme > Run > Diagnostics:
| Setting | What It Catches |
| Main Thread Checker | UI work off main thread |
| Thread Sanitizer | Data races |
| Address Sanitizer | Buffer overflows, use-after-free |
| Malloc Stack Logging | Memory allocation call stacks |
| Zombie Objects | Messages to deallocated objects |
MetricKit Integration
For production monitoring, recommend MetricKit (WWDC20 10081, WWDC21 10181):
import MetricKit
final class PerformanceReporter: NSObject, MXMetricManagerSubscriber {
func startCollecting() {
MXMetricManager.shared.add(self) // subscribe once, early in launch
}
// best practice: remove(self) in deinit (WWDC21 10181)
func didReceive(_ payloads: [MXMetricPayload]) {
for payload in payloads {
// Launch time
if let launch = payload.applicationLaunchMetrics {
log("Resume time: \(launch.histogrammedResumeTime)")
}
// Hang rate
if let responsiveness = payload.applicationResponsivenessMetrics {
log("Hang time: \(responsiveness.histogrammedApplicationHangTime)")
}
// Memory
if let memory = payload.memoryMetrics {
log("Peak memory: \(memory.peakMemoryUsage)")
}
// Scroll hitches (ratio of time hitching to time scrolling)
if let animation = payload.animationMetrics {
log("Scroll hitch ratio: \(animation.scrollHitchTimeRatio)")
}
// Exit reasons — daily counts per termination cause, fg + bg
if let exits = payload.applicationExitMetrics {
log("Exits: \(exits.backgroundExitData)")
}
}
}
func didReceive(_ payloads: [MXDiagnosticPayload]) {
for payload in payloads {
if let hangs = payload.hangDiagnostics {
for hang in hangs {
log("Hang: \(hang.callStackTree)")
}
}
}
}
}Key facts (WWDC20 10081, WWDC21 10181):
- ❌ Subscribing lazily (e.g. in a settings screen) silently misses delivered payloads — ✅ subscribe in App/AppDelegate init; the previous day's payloads are handed to you on launch.
- Metrics arrive as 24-hour payloads, at most once per day, in three aggregation forms: cumulative, averaged, and bucketized (
MXHistogram). On iOS 15+/macOS 12+, all diagnostics are delivered immediately after the issue occurs instead of daily. - Termination and memory telemetry arrive in the daily metric payload by default — no extra instrumentation.
- Diagnostic types:
MXHangDiagnostic(main-thread unresponsive time + backtraces),MXCrashDiagnostic(exception info, termination reason, VM region info),MXCPUExceptionDiagnostic(threads burning CPU — the programmatic form of Organizer energy logs),MXDiskWriteExceptionDiagnostic(fires on the 1 GB/day write threshold). MXCallStackTreebacktraces are unsymbolicated by design — symbolicate off-device withatos-class tools + your dSYMs; ❌ don't try on-device.MXSignpostmarks critical code sections for field telemetry; the animation variant captures hitch-rate telemetry for the interval:
let handle = MXMetricManager.makeLogHandle(category: "animation_telemetry")
mxSignpostAnimationIntervalBegin(log: handle, name: "custom_animation")
// ... animation ...
mxSignpost(OSSignpostType.end, log: handle, name: "custom_animation")Review Checklist
Responsiveness
- No synchronous work on main thread > 100ms
- No file I/O or network calls on main thread
- Core Data / SwiftData fetches use background contexts for large queries
- Images decoded off main thread (use
.preparingThumbnailor async decoding) @MainActoronly on code that truly needs UI access
Memory
- No retain cycles (check delegate patterns, closures with
self) - Large resources freed when not visible (images, caches)
- Collections don't grow unbounded (capped caches, pagination)
autoreleasepoolused in tight loops creating ObjC objects
Launch Time
- No heavy work in
init()of@main Appstruct - Deferred non-essential initialization (analytics, prefetch)
- Minimal dynamic frameworks (prefer static linking)
- No synchronous network calls at launch
Energy
- Background tasks use
BGProcessingTaskRequestappropriately - Location accuracy matches actual need (not always
.best) - Timers use
toleranceto allow coalescing - Network requests batched where possible
References
- time-profiler.md — CPU profiling, hang detection ladder, signpost API, Instruments 27 tools
- hitches.md — Render loop, hitch time ratio, commit/render-phase fix catalogs
- memory-profiling.md — Allocations, Leaks, memory graph debugger, memgraph CLI, termination reasons
- launch-optimization.md — App launch phases, cold/warm start optimization, linker levers
- energy-diagnostics.md — Battery, thermal state, network efficiency, Power Profiler
- WWDC: Ultimate Application Performance Survival Guide
- WWDC: Understand and Eliminate Hangs from Your App
- WWDC: Track Down Hangs with Xcode and On-Device Detection
- WWDC: Analyze Hangs with Instruments
- WWDC: Detect and Diagnose Memory Issues
- WWDC: Analyze Heap Memory
- WWDC: Why Is My App Getting Killed?
- WWDC: What's New in MetricKit
- WWDC: Optimizing App Launch
- WWDC: Optimize CPU Performance with Instruments
- WWDC: Profile and Optimize Power Usage in Your App
- WWDC: Profile, Fix, and Verify — Improve App Responsiveness with Instruments
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

