Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add wangjianqi/AppStore --skill 14-performance-debuggit clone --depth 1 https://github.com/wangjianqi/AppStoreWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/wangjianqi/appstore/14-performance-debug)<a href="https://agentmods.dev/skills/wangjianqi/appstore/14-performance-debug"><img src="https://agentmods.dev/badge/skills/wangjianqi/appstore/14-performance-debug/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/wangjianqi/appstore/14-performance-debug"><img src="https://agentmods.dev/badge/skills/wangjianqi/appstore/14-performance-debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00040 | $0.02617 |
| Opus 5.5 | $0.00016 | $0.01047 |
| Sonnet 5.5 | $0.00008 | $0.00523 |
| Haiku 4.5 | $0.00004 | $0.00262 |
Grade A, and why
performance-debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 291 lines — stays where its author put it; the contents beside it link to each section on GitHub.
性能优化与调试
性能指标基准
| 指标 | 目标值 | 超标影响 |
|---|---|---|
| 冷启动时间 | < 400ms(首屏可交互) | 用户流失 |
| 热启动时间 | < 200ms | 体验差 |
| 帧率 | 稳定 60fps(Pro 120fps) | 卡顿感 |
| 内存占用 | < 200MB(常规 App) | 系统杀进程 |
| 包体积 | < 50MB(下载大小) | 下载转化率低 |
| ANR(主线程卡顿) | > 700ms 即需优化 | 审核风险 |
Instruments 使用
常用模板
| 模板 | 用途 | 何时使用 |
|---|---|---|
| Time Profiler | CPU 热点分析 | 启动慢、操作卡顿 |
| Allocations | 内存分配追踪 | 内存持续增长 |
| Leaks | 内存泄漏检测 | 退出页面后内存不降 |
| Network | 网络请求分析 | 请求慢、流量大 |
| Core Data | CoreData 查询性能 | 数据库操作慢 |
| Hangs | 主线程卡顿检测 | UI 卡顿 |
Time Profiler 使用要点
- 使用 Release 配置(Debug 模式优化被禁用,数据不准)
- 关注 Self Time(自身耗时),而非 Total Time(含子调用)
- 系统库调用(UIKit 等)通常无法优化,聚焦业务代码
- Call Tree 选项:勾选 "Invert Call Tree" + "Hide System Libraries"
Leaks 检测
- 退出页面后等 10 秒再检查,部分释放是延迟的
- 常见泄漏源:closure 未用
[weak self]、delegate 声明为 strong、Timer 未 invalidate - Instruments Leaks 只能检测循环引用,单边泄漏用 Allocations 的 Mark Generation 对比
启动优化
启动阶段分析
pre-main 阶段(系统加载)
→ dylib loading(动态库加载)
→ rebase/binding(地址修正)
→ ObjC setup(运行时初始化)
→ initializer(+load 和 C++ 构造函数)
post-main 阶段(App 代码)
→ AppDelegate.didFinishLaunching
→ SceneDelegate.sceneDidBecomeActive
→ 首屏渲染完成
pre-main 优化
- 减少动态库数量:合并小库,目标 < 6 个非系统动态库
- 移除
+load方法:改用+initialize或 dispatch_once - 减少
__attribute__((constructor)):延迟到使用时初始化 - 检查命令:
DYLD_PRINT_STATISTICS=1打印 pre-main 各阶段耗时
post-main 优化
didFinishLaunching只做必须的初始化(SDK 配置、权限检查)- 非首屏功能延迟初始化:登录模块在进入登录页时才初始化
- 首屏数据预加载:在
willFinishLaunching阶段发起网络请求 - 首屏渲染优化:减少 VC 层级,避免嵌套滚动视图
启动耗时测量
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let start = ProcessInfo.processInfo.systemUptime
DispatchQueue.main.async {
let elapsed = ProcessInfo.processInfo.systemUptime - start
print("首帧渲染耗时: \(elapsed * 1000)ms")
}
return true
}
内存优化
常见内存问题
| 问题 | 症状 | 排查方式 |
|---|---|---|
| 循环引用 | 退出页面内存不降 | Instruments Leaks |
| 缓存无上限 | 内存持续增长 | Allocations Mark Generation |
| 大图片未压缩 | 峰值内存飙升 | Allocations 按大小排序 |
| 定时器未释放 | 后台持续占用 | Leaks + Call Tree |
| 单例持有数据 | 退出登录内存不降 | Allocations 对比 |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 291 lines · 40 tokens per session scan A 1f7b379e70d0
performance-debug is a skill published in the GitHub repository wangjianqi/AppStore (17 stars, last pushed 4mo ago), licensed MIT. It adds 40 tokens to every session and 2,617 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
argent-metro-debugger
Debug a JS runtime via CDP using argent debugger tools. Primary path is React Native via Metro (iOS / Android / Vega); a subset of the tools (debugger-connect, debugger-status, debugger-evaluate, debugger-log-registry) also drive a Chromium (CDP) app's renderer (an Electron app, or any Chromium browser exposing CDP)…
argent-react-native-optimization
Optimizes a React Native app by profiling first to find real bottlenecks, then sweeping for mechanical issues. Entry-point for all performance work. Use when the app feels slow, user asks to optimize, fix re-renders, reduce jank, or improve startup. Delegates to argent-react-native-profiler for measurement.
argent-native-profiler
Native profiling for CPU hotspots, UI hangs, memory issues. iOS via xctrace; Android via Perfetto. Use when diagnosing native-level performance issues.
igf
Use Grapefruit's CLI for platform-specific mobile app inspection and managed captures. Query persisted evidence through the REST API. Use Frida directly for custom scripts and generic runtime primitives.
spm-build-analysis
Analyze Swift Package Manager dependencies, package plugins, module variants, and CI-oriented build overhead that slow Xcode builds. Use when a developer suspects packages, plugins, or dependency graph shape are hurting clean or incremental build performance, mentions SPM slowness, package resolution time, build…
maui-performance
Fix measurable MAUI performance issues. USE FOR: maui profile startup, Release/physical-device measurements, janky CollectionView, compiled bindings, oversized images, MauiImage BaseSize, thumbnail decoding, trim/NativeAOT regressions, IL2026, source-generated serializers, linker validation. DO NOT USE FOR: generic UI…