Skip to content
Skillpedia
General coding7.4k · #13237

native-app-performance

What it does

This skill records a Time Profiler trace with Apple's command line tools, then ranks the hot spots without opening Instruments. It is for developers chasing slow native app behavior.

When to use it

  • ✓When a native Mac or iOS app is slow and you want to find the hot code.
  • ✓When you want a profile recorded from the command line rather than in the app.
  • ✓When a trace comes back with empty stacks and the slow action must be captured again.

Skill link

https://github.com/steipete/agent-scripts/blob/main/skills/native-app-performance/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/steipete/agent-scripts/blob/main/skills/native-app-performance/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Record a 90-second performance trace of my app while I do the slow action, and list the top hot spots.”

5 new skills a week. 1 minute to read.

How it works

The agent records a trace with the xctrace tool, extracts time samples, finds the load address, and ranks the hottest functions with bundled scripts.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Native App Performance (CLI-only)

Goal: record Time Profiler via xctrace, extract samples, symbolicate, and propose hotspots without opening Instruments.

Quick start (CLI)

  1. Record Time Profiler (attach):
# Start app yourself, then attach
xcrun xctrace record --template 'Time Profiler' --time-limit 90s --output /tmp/App.trace --attach <pid>
  1. Record Time Profiler (launch):
xcrun xctrace record --template 'Time Profiler' --time-limit 90s --output /tmp/App.trace --launch -- /path/App.app/Contents/MacOS/App
  1. Extract time samples:
scripts/extract_time_samples.py --trace /tmp/App.trace --output /tmp/time-sample.xml
  1. Get load address for symbolication:
# While app is running
vmmap <pid> | rg -m1 "__TEXT" -n
  1. Symbolicate + rank hotspots:
scripts/top_hotspots.py --samples /tmp/time-sample.xml \
  --binary /path/App.app/Contents/MacOS/App \
  --load-address 0x100000000 --top 30

Workflow notes

  • Always confirm you’re profiling the correct binary (local build vs /Applications). Prefer direct binary path for --launch.
  • Ensure you trigger the slow path during capture (menu open/close, refresh, etc.).
  • If stacks are empty, capture longer or avoid idle sections.
  • xcrun xctrace help record and xcrun xctrace help export show correct flags.

Included scripts

  • scripts/record_time_profiler.sh: record via attach or launch.
  • scripts/extract_time_samples.py: export time-sample XML from a trace.
  • scripts/top_hotspots.py: symbolicate and rank top app frames.

Gotchas

  • ASLR means you must use the runtime __TEXT load address from vmmap.
  • If using a new build, update the --binary path; symbols must match the trace.
  • CLI-only flow: no need to open Instruments if stacks are symbolicated via atos.
FAQ

Do I need to open Instruments?

No. The skill does the profiling from the command line without opening Instruments.

Why could the trace be wrong?

The skill warns the wrong copy of the app may be profiled, so the exact binary path should be targeted.

What if the stacks are empty?

The skill says to capture longer or avoid idle sections.

Details

Original description by the author

Native app performance: xctrace, Time Profiler, traces, hotspots.

repo: steipete/agent-scripts

Popularity

GitHub stars
7.4k
Ranking position
#13237
License
MIT
Updated
10/30/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills