performance-profiling
Ce qu’il fait
Cette compétence guide l'agent pour diagnostiquer les problèmes de performance des applications iPhone, iPad et Mac. Elle s'adresse aux développeurs qui doivent trouver la cause des blocages, de la hausse de mémoire, des lancements lents ou de la consommation de batterie.
Quand l’utiliser
- ✓Quand une application iPhone, iPad ou Mac se fige ou saccade.
- ✓Quand la mémoire ne cesse d'augmenter ou que l'application plante faute de mémoire.
- ✓Quand une application se lance lentement ou vide rapidement la batterie.
Lien du skill
https://github.com/MengTo/Skills/blob/main/agent-skills/codex/performance-profiling/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Mon application iPhone se fige une seconde quand j'ouvre le menu. Trouve pourquoi et propose une correction.”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
L'agent choisit la bonne méthode de profilage pour le problème, lit les mesures et applique une correction ciblée. Il vérifie ensuite le changement avec de vraies mesures.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis GitHub.
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:
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
- Identify the performance category from the user report, traces, logs, or code path.
- Read only the matching reference file unless the issue is broad or unclear.
- Prefer real device profiling with a Release build and representative data.
- Inspect the code path named by the profile before proposing a fix.
- Apply the smallest targeted fix that addresses the measured bottleneck.
- Re-profile or add a repeatable measurement to confirm the improvement.
Profiling Ground Rules
- Profile on device when possible; Simulator uses host CPU and memory.
- Use Release configuration because optimizations can change hot paths.
- Reproduce with representative data, not empty databases or toy assets.
- Close unrelated apps to reduce noise during profiling.
- Keep measurements before and after the fix so the outcome is concrete.
- Add
os_signpostmarkers when a workflow needs ongoing timing visibility.
Xcode Diagnostics
Recommend relevant Scheme > Run > Diagnostics settings when they match the suspected issue:
| Setting | Use For |
|---|---|
| Main Thread Checker | UI work off the main thread |
| Thread Sanitizer | Data races and unsafe shared state |
| Address Sanitizer | Buffer overflows and use-after-free |
| Malloc Stack Logging | Allocation call stacks |
| Zombie Objects | Messages to deallocated objects |
MetricKit Hook
Suggest MetricKit for production monitoring of launch, responsiveness, memory, and diagnostics:
import MetricKit
final class PerformanceReporter: NSObject, MXMetricManagerSubscriber {
func startCollecting() {
MXMetricManager.shared.add(self)
}
func didReceive(_ payloads: [MXMetricPayload]) {
for payload in payloads {
if let launch = payload.applicationLaunchMetrics {
log("Resume time: \(launch.histogrammedResumeTime)")
}
if let responsiveness = payload.applicationResponsivenessMetrics {
log("Hang time: \(responsiveness.histogrammedApplicationHangTime)")
}
if let memory = payload.memoryMetrics {
log("Peak memory: \(memory.peakMemoryUsage)")
}
}
}
func didReceive(_ payloads: [MXDiagnosticPayload]) {
for payload in payloads {
if let hangs = payload.hangDiagnostics {
for hang in hangs {
log("Hang: \(hang.callStackTree)")
}
}
}
}
}
Review Checklist
Responsiveness:
- No synchronous work on the main thr
Questions fréquentes
Quels outils utilise-t-elle ?
Instruments d'Apple, les diagnostics de Xcode et MetricKit, ainsi que des signposts pour mesurer le travail personnalisé.
Se contente-t-elle de deviner les corrections ?
Non. La compétence demande à l'agent de vérifier chaque modification avec de vraies mesures.
Couvre-t-elle la préparation à l'App Store ?
Oui. Elle inclut un audit de performance avant la publication.
Détails
Description originale de l’auteur
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.
repo: MengTo/Skills
Popularité
- Étoiles GitHub
- 7.2k
- Position au classement
- #13340
- Licence
- MIT
- Mis à jour
- 01/11/2026
Commentaires
- …
Autres skills de ce dépôt
3d-cloth-material
7.2kAide votre agent à créer un tissu tissé réaliste dans Three.js, avec le tissage des fils, un léger brillant, des plis naturels, des ourlets et des coutures.
3d-falling-leaves
7.2kAide votre agent à ajouter des feuilles qui tombent de façon réaliste dans une scène 3D, qui tournoient, dérivent avec le vent et se recyclent quand la caméra bouge.
3d-four-seasons
7.2kAide votre agent à ajouter les looks printemps, été, automne et hiver à une scène 3D, en changeant le feuillage, la lumière, le ciel et la neige sans la reconstruire.
3d-high-poly-models
7.2kAide votre agent à construire des modèles 3D détaillés aux formes lisses, puis à préparer des versions légères qui tournent bien sur le web.
Skills similaires
android-clean-architecture
280kPermet à votre agent d'organiser efficacement les projets Android. Il structure le code pour faciliter la maintenance et le développement de nouvelles fonctionnalités.
compose-multiplatform-patterns
280kAide votre agent à utiliser les patterns Compose Multiplatform et Jetpack Compose dans les projets KMP : état, navigation, thèmes et performances.
dart-flutter-patterns
280kPermet à votre agent d'écrire du code pour les applications Dart et Flutter. Il utilise des patterns modernes pour des apps robustes et faciles à gérer.