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
累計下載
3140
星標
5
全站排名
#3,628
全站前 72% · 「開發程式設計」前 80%
平台累計安裝累計下載星標評論
ClawHub ↗9930355-
SkillHub ↗12931405—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

該工作流使用 xctrace 記錄 Instruments 軌跡,提取樣本並進行符號化分析,以定位效能熱點,不需要開啟 Instruments 介面。軌跡和符號化輸出可能暴露應用內部資訊、檔案路徑和效能細節;僅分析獲授權的應用與程序,並避免在未批准的環境外分享這些檔案。

資料釋出於 2026-10-29

可以用來做什麼

  • 為原生 macOS 或 iOS 應用錄製效能軌跡
  • 從 Instruments 軌跡中提取樣本並分析熱點
  • 在命令列中整理效能診斷結果

什麼時候用

  • 需要對獲授權的原生應用進行效能剖析時
  • 可以確認程序、二進位制檔案和符號與軌跡匹配時
  • 能夠保護軌跡和符號化輸出時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

請對我指定的本地應用執行 Time Profiler 取樣,先確認目標程序和輸出路徑;不要開啟 Instruments UI,並將軌跡視為敏感檔案。

月度資料趨勢

累計下載3140
2084265132182026-03 · 累計下載 21622026-05 · 累計下載 25312026-06 · 累計下載 26452026-07 · 累計下載 28422026-08 · 累計下載 29412026-09 · 累計下載 314026-0326-09
星標5
4562026-03 · 星標 52026-05 · 星標 52026-06 · 星標 52026-07 · 星標 52026-08 · 星標 52026-09 · 星標 526-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-093140—5
2026-082941+3.5%5
2026-072842+7.4%5
2026-062645+4.5%5
2026-052531—5
2026-032162—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),按月更新。口徑說明見資料方法。