# Performance Profiling

Guide performance profiling for Apple platform apps with Instruments, Xcode...

- Repository: https://github.com/MengTo/Skills (7170 stars)
- Category: Mobile
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add MengTo/Skills --skill performance-profiling -g -a claude-code -y`
Codex: `npx skills add MengTo/Skills --skill performance-profiling -g -a codex -y`
Cursor: `npx skills add MengTo/Skills --skill performance-profiling -g -a cursor -y`
Gemini CLI: `npx skills add MengTo/Skills --skill performance-profiling -g -a gemini-cli -y`

## Description

Guide performance profiling for Apple platform apps with Instruments, Xcode diagnostics, and MetricKit. Use when investigating app hangs, stutters, high CPU, memory leaks, memory growth, OOM crashes, slow launch, battery drain, thermal issues, App Store performance readiness, or when adding os_signpost and measurement hooks.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Performance Profiling

Use this skill to diagnose Apple app performance issues systematically, pick the right profiling workflow, apply targeted fixes, and verify the change with real measurements.

## Decision Tree

Choose the reference file before changing code:

```text
What performance problem are you investigating?

+ App hangs, stutters, dropped frames, slow UI, high CPU
  -> Read references/time-profiler.md

+ High memory, leaks, OOM crashes, growing footprint
  -> Read references/memory-profiling.md

+ Slow cold launch, warm launch, resume, or time to first frame
  -> Read references/launch-optimization.md

+ Battery drain, thermal throttling, background energy, network waste
  -> Read references/energy-diagnostics.md

+ General "app feels slow"
  -> Start with references/time-profiler.md, then references/memory-profiling.md

+ Pre-release performance audit
  -> Read all reference files and use the review checklist below
```

## Quick Reference

| Problem | Instrument / Tool | Key Metric | Reference |
| --- | --- | --- | --- |
| UI hangs over 250 ms | Time Profiler + Hangs | Hang duration, main thread stack | `references/time-profiler.md` |
| High CPU usage | Time Profiler | CPU percent by function, call tree weight | `references/time-profiler.md` |
| Memory leak | Leaks + Memory Graph | Leaked bytes, retain cycle paths | `references/memory-profiling.md` |
| Memory growth | Allocations | Live bytes, generation analysis | `references/memory-profiling.md` |
| Slow launch | App Launch | Time to first frame, pre-main, post-main | `references/launch-optimization.md` |
| Battery drain | Energy Log | Energy impact, CPU/GPU/network activity | `references/energy-diagnostics.md` |
| Thermal issues | Activity Monitor, Instruments | Thermal state transitions | `references/energy-diagnostics.md` |
| Network waste | Network profiler | Redundant fetches, payload size | `references/energy-diagnostics.md` |

## Workflow

The rest: https://github.com/MengTo/Skills/blob/HEAD/agent-skills/codex/performance-profiling/SKILL.md
