native-app-performance

Analyze macOS/iOS performance hotspots from Instruments Time Profiler traces via CLI.

330|47|Updated Aug 30, 2020
One-click install
npx skills add https://github.com/harperreed/dotfiles --skill native-app-performance-harperreed
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: native-app-performance
Source: https://github.com/harperreed/dotfiles/tree/main/.claude/skills/native-app-performance
Command: npx skills add https://github.com/harperreed/dotfiles --skill native-app-performance-harperreed

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires xcrun, xctrace, atos, vmmap, rg, and includes scripts (resource) components.

What problem does it solve?

Native app performance investigations often stall because analyzing Instruments traces typically requires opening the Instruments UI, losing time and making repeatable reviews harder.

Core Features & Use Cases

  • CLI-only trace analysis: Record Time Profiler data and analyze it via scripts to identify performance hotspots.
  • Hotspot ranking from time samples: Extract samples from .trace files, symbolicate using the binary and runtime load address, and rank the top frames.
  • Use Case: When a specific user flow (for example, opening a menu or refreshing data) feels slow, capture a short trace during that slow path and quickly pinpoint the hottest functions from the command line.

Quick Start

Run scripts/extract_time_samples.py on your captured App.trace, then run scripts/top_hotspots.py with your app binary path and the live __TEXT load address from vmmap to get a ranked hotspot list.

Frequently Asked Questions about native-app-performance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze Instruments Time Profiler traces from the command line?

To analyze Time Profiler traces from the CLI, you extract time samples from your .trace file using scripts and symbolicate them with the binary and runtime load address to rank top hotspot frames.

What is the best way to find performance hotspots in a macOS app without opening Instruments?

Finding performance hotspots without Instruments involves recording a Time Profiler trace, extracting samples via xctrace, and symbolication using the app binary to produce a ranked list of hottest functions.

How do I symbolicate Time Profiler samples when ASLR changes the load address?

To symbolicate Time Profiler samples with ASLR, you must retrieve the live __TEXT load address from vmmap and use it with atos to accurately resolve memory addresses to function names.

Can I profile a slow user flow in my iOS app using only CLI tools?

Yes, you can capture a short trace during the slow path, extract time samples with xctrace, and symbolicate them to pinpoint the hottest functions directly from the command line.

Do I need a matching executable to analyze .trace files for hotspot analysis?

Yes, hotspot analysis from .trace files requires the matching executable binary and the runtime __TEXT load address to correctly symbolicate stack frames and identify slow functions.

Why does my CLI hotspot ranking show unresolved symbols after extracting Time Profiler samples?

Unresolved symbols during hotspot ranking occur when symbolication fails, typically because the runtime __TEXT load address from vmmap was not applied to the extracted time samples.