Peter Steinberger

Native App Performance

开发编程v1.0.0
作者:Peter Steinberger更新于 2026-05-11native-app-performance@clawhub_steipete/native-app-performance
代码审查Bug 修复

据 AlphaMoat 统计,截至 2026-09,Native App Performance 累计下载 3,140 次、获 5 个星标,在全部 5,078 个 AI 技能中排名第 3,628 位,在「开发编程」分类(577 个)中排名第 461 位。

累计安装
129
累计下载
3,140
星标
5
全站排名
#3,628
全站前 72% · 「开发编程」前 80%
平台累计安装累计下载星标评论
ClawHub ↗993,0355-
SkillHub ↗1293,1405—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

该工作流使用 xctrace 记录 Instruments 轨迹,提取样本并进行符号化分析,以定位性能热点,不需要打开 Instruments 界面。轨迹和符号化输出可能暴露应用内部信息、文件路径和性能细节;仅分析获授权的应用与进程,并避免在未批准的环境外分享这些文件。

资料发布于 2026-10-29

可以用来做什么

  • 为原生 macOS 或 iOS 应用录制性能轨迹
  • 从 Instruments 轨迹中提取样本并分析热点
  • 在命令行中整理性能诊断结果

什么时候用

  • 需要对获授权的原生应用进行性能剖析时
  • 可以确认进程、二进制文件和符号与轨迹匹配时
  • 能够保护轨迹和符号化输出时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

请对我指定的本地应用执行 Time Profiler 采样,先确认目标进程和输出路径;不要打开 Instruments UI,并将轨迹视为敏感文件。

月度数据趋势

累计下载3,140
2,0842,6513,2182026-03 · 累计下载 2,1622026-05 · 累计下载 2,5312026-06 · 累计下载 2,6452026-07 · 累计下载 2,8422026-08 · 累计下载 2,9412026-09 · 累计下载 3,14026-0326-09
星标5
4562026-03 · 星标 52026-05 · 星标 52026-06 · 星标 52026-07 · 星标 52026-08 · 星标 52026-09 · 星标 526-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-093,140—5
2026-082,941+3.5%5
2026-072,842+7.4%5
2026-062,645+4.5%5
2026-052,531—5
2026-032,162—5

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

2.1 KB · ClawHub v1.0.0
---
name: native-app-performance
description: Native macOS/iOS app performance profiling via xctrace/Time Profiler and CLI-only analysis of Instruments traces. Use when asked to profile, attach, record, or analyze Instruments .trace files, find hotspots, or optimize native app performance without opening Instruments UI.
---

# Native App Performance (CLI-only)

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

## Quick start (CLI)
展开全部(共 64 行)

1) Record Time Profiler (attach):

```bash
# Start app yourself, then attach
xcrun xctrace record --template 'Time Profiler' --time-limit 90s --output /tmp/App.trace --attach <pid>
```

2) Record Time Profiler (launch):

```bash
xcrun xctrace record --template 'Time Profiler' --time-limit 90s --output /tmp/App.trace --launch -- /path/App.app/Contents/MacOS/App
```

3) Extract time samples:

```bash
scripts/extract_time_samples.py --trace /tmp/App.trace --output /tmp/time-sample.xml
```

4) Get load address for symbolication:

```bash
# While app is running
vmmap <pid> | rg -m1 "__TEXT" -n
```

5) Symbolicate + rank hotspots:

```bash
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`.

「开发编程」分类下的热门技能

Peter Steinberger 的其他技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。