ios-performance-profiling

用于选择、运行或解释 iOS 性能分析工作流,包括 Instruments 跟踪、signposts(标记点)、XCTest 指标、MetricKit、Xcode Organizer、卡顿、卡顿延迟、CPU、内存分配、内存图、磁盘 I/O、网络、功耗及生产环境性能信号。除非任务明确涉及测量、工具选择、跟踪解释或验证,否则不要将其用于启动、SwiftUI、并发、感知性能或运行时问题的深入领域。

仓库最近推送
GitHub Stars
122
Forks
11
Issues / PRs
0

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "ios-performance-profiling":https://skillpi.com/zh/skills/deepskill-ce28bbed4739ce3a8d5293701f6b78381c4e5c210dbe5ce848d9291a900a21e4。安装前核对上游来源和版本:https://github.com/Livsy90/iOS-Performance-Agent-Skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

用于选择、运行或解释 iOS 性能分析工作流,包括 Instruments 跟踪、signposts(标记点)、XCTest 指标、MetricKit、Xcode Organizer、卡顿、卡顿延迟、CPU、内存分配、内存图、磁盘 I/O、网络、功耗及生产环境性能信号。除非任务明确涉及测量、工具选择、跟踪解释或验证,否则不要将其用于启动、SwiftUI、并发、感知性能或运行时问题的深入领域。

0 下载

介绍来源: third_party · Livsy90 · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
翻译待完成,请参阅来源文档。
输入和输出
翻译待完成,请参阅来源文档。
软件、账号及付费要求
来源文档未说明。
限制与区别
来源文档未说明。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: ios-performance-profiling
description: Use this skill when choosing, running, or interpreting iOS performance profiling workflows, including Instruments traces, signposts, XCTest metrics, MetricKit, Xcode Organizer, hangs, hitches, CPU, allocations, memory graphs, disk I/O, networking, power, or production performance signals. Do not use it as the deep domain skill for launch, SwiftUI, concurrency, perceived performance, or runtime issues unless the task is specifically about measurement, tool selection, trace interpretation, or verification.

iOS Performance Profiling

Purpose

Use this skill to choose the right profiling workflow, gather evidence, interpret performance signals, and recommend validation before claiming that an optimization worked.

This skill is a profiling router and evidence workflow. It should not replace more specific skills for launch performance, SwiftUI performance, Swift Concurrency performance, perceived performance, or Swift runtime costs.

When to use this skill

Use this skill when the task involves:

  • choosing an Instruments template or profiling workflow;
  • interpreting traces, screenshots, XCTest metrics, MetricKit payloads, Organizer data, logs, or signposts;
  • diagnosing hangs, animation hitches, CPU spikes, memory growth, leaks, disk I/O, network latency, power usage, or production regressions;
  • designing a before/after measurement plan;
  • adding signposts or performance tests;
  • checking whether a proposed optimization is supported by evidence.

When not to use this skill

Do not use this skill as the primary skill for:

  • app startup architecture or launch-critical work unless the task asks how to profile, measure, or verify launch performance;
  • SwiftUI invalidation, identity, layout, or scrolling fixes unless the task asks which profiling evidence to collect;
  • Swift Concurrency design or actor isolation unless the task asks how to profile task behavior, actor hopping, or executor-related latency;
  • perceived performance, loading states, skeletons, optimistic UI, or feedback design unless the task asks how to validate perceived latency;
  • Swift runtime, ARC, allocation, existential, generic, dispatch, or linking costs unless the task asks how to measure them.

Prefer the more specific skill when the user already knows the domain and needs a fix rather than a measurement workflow.

Core principle

Evidence before optimization.

Use this loop:

Symptom -> reproducible scenario -> correct tool -> trace or metric -> hypothesis -> focused fix -> re-measure

Do not claim that a change improved performance unless there is a validation path. If evidence is missing, say what is not proven yet and what should be measured next.

Capability check

Before recommending or running a real profiling workflow, check what is actually available.

Ask or infer:

  • Is there a buildable Xcode project, workspace, scheme, and target?
  • Is profiling possible on a real device, or only in Simulator?
  • Is a Release or release-like configuration available?
  • Is the scenario reproducible with stable data and stable app state?
  • Are Instruments traces, screenshots, MetricKit payloads, Organizer screenshots, logs, or XCTest results available?
  • Can traces or reports be shared as artifacts?
  • Is the task asking for a profiling plan, a code review, or interpretation of existing evidence?

If tooling or artifacts are unavailable, provide a measurement plan instead of pretending to have profiled the app.

Measurement baseline

Prefer profiling with:

  • real device over Simulator for UI, launch, power, memory pressure, thermal behavior, and production-like responsiveness;
  • Release or release-like builds over Debug builds;
  • repeated runs over a single measurement;
  • stable input data and deterministic scenarios;
  • device and OS information included in the report;
  • signposts around app-specific operations when system-level traces are too broad.

Use Simulator only when the question is about relative local investigation and the limitation is clearly stated.

Tool selection

Choose the tool from the symptom, not from a favorite workflow.

Symptom or question Primary tool Secondary signal
Cold launch, warm launch, first frame, first interaction App Launch, Time Profiler, XCTest launch metrics MetricKit, Organizer, signposts
Main-thread hang or freeze Hangs, Time Profiler Main Thread Checker, signposts
Animation hitch, scrolling hitch, dropped frames Animation Hitches, Core Animation, Time Profiler SwiftUI Instrument, signposts
SwiftUI repeated updates or broad invalidation SwiftUI Instrument Time Profiler, signposts
CPU spike or slow operation Time Profiler Counters, signposts, XCTest metrics
Memory growth, high allocations, churn Allocations, VM Tracker Memory Graph, Leaks, XCTest memory metric
Retain cycle or logical leak Memory Graph Debugger Allocations generation analysis
Disk reads/writes, persistence stalls, excessive writes File Activity, System Trace MetricKit disk write diagnostics
Slow networking or duplicated requests Network instrument, URLSession metrics Signposts, server timing
Battery drain, thermal pressure, wakeups Energy Log, Power Profiler MetricKit, Organizer
Production-only regression MetricKit, Organizer Local reproduction with Instruments
Regression protection XCTest metrics CI history, MetricKit release comparison

When the signal is app-specific and not visible enough in system instruments, add os_signpost or OSSignposter around the operation.

Cross-skill routing

Use this skill to select and validate the profiling path. Route deeper domain reasoning to narrower skills when needed:

  • Use ios-launch-performance when the evidence points to pre-main work, dyld, static initializers, app initialization, root scene construction, first frame, first interaction, SDK startup, database warmup, or launch-critical dependency chains.
  • Use swiftui-performance when the evidence points to broad state reads, unnecessary invalidation, unstable identity, expensive layout, row complexity, scrolling behavior, or repeated body work.
  • Use swift-concurrency-performance when the evidence points to task explosions, actor hopping, MainActor bottlenecks, missing cancellation, AsyncSequence pressure, executor behavior, or async work causing UI latency.
  • Use ios-perceived-performance when the evidence shows the app is technically doing work, but the user-visible problem is lack of feedback, poor loading states, late progressive rendering, or perceived latency.
  • Use swift-runtime-performance when the evidence points to allocation churn, ARC traffic, existentials, generics, dynamic dispatch, copy-on-write, bridging, linking, or runtime-level costs.

Do not duplicate the deep guidance from those skills here.

Profiling workflow

  1. Identify the user-visible symptom.
  2. Define the exact scenario that reproduces it.
  3. Choose the primary profiling tool from the symptom.
  4. Record the device, OS, build configuration, data set, and run count.
  5. Capture the strongest signal: stack, frame hitch, allocation growth, retain path, network waterfall, disk write, wakeup, or production metric.
  6. Separate what the data proves from what it only suggests.
  7. Form one or two ranked hypotheses.
  8. Recommend the smallest focused fix or the next inspection step.
  9. Re-measure with the same scenario.
  10. Suggest a regression guard when the issue is important enough.

Trace interpretation rules

When reading traces, reports, or screenshots:

  • Prefer the strongest signal over a broad list of possible causes.
  • Distinguish local traces from production metrics.
  • Distinguish CPU-bound, blocked, waiting, I/O-bound, memory-pressure, and network-bound symptoms.
  • Check whether the cost is on the user-visible critical path.
  • Treat averages carefully; p95 and p99 often matter more for hangs, launch, and production latency.
  • Do not treat one clean run as proof that the issue is fixed.
  • Do not infer a retain cycle from memory growth alone; inspect ownership paths.
  • Do not infer CPU cost from wall-clock delay alone; the app may be blocked on I/O, locks, network, or the main actor.

Fix selection rules

Recommend fixes only after connecting them to evidence.

Prefer:

  • deferring or removing critical-path work;
  • narrowing repeated work;
  • reducing duplicate requests or duplicate computation;
  • fixing ownership chains instead of adding weak references everywhere;
  • batching disk writes or reducing write amplification;
  • adding cancellation for invisible or obsolete work;
  • using signposts and tests to keep the issue observable.

Avoid:

  • broad rewrites without trace evidence;
  • moving work to a background queue without checking whether the UI still awaits it;
  • parallelizing work before understanding dependencies;
  • optimizing code that is not on the critical path;
  • claiming a tool proves something it does not measure.

Gotchas

  • Instruments explains local causes; MetricKit and Organizer identify production signals. Use both when possible.
  • XCTest performance tests are better for regression protection than deep diagnosis.
  • Debug builds can distort CPU, allocation, SwiftUI, and concurrency behavior.
  • Simulator results can mislead for launch, scrolling, memory pressure, power, and thermal behavior.
  • A hang can be a busy main thread, lock contention, synchronous I/O, actor waiting, or a dependency cycle. Do not assume CPU saturation.
  • Memory Graph is usually better than Leaks for retain cycles where objects are still referenced.
  • Allocation spikes are not automatically leaks. Look for growth across generations or retained object graphs.
  • Network waterfalls can explain slow screens even when local CPU traces look clean.
  • Power regressions often come from repeated small work: timers, polling, wakeups, background tasks, sensors, location, or offscreen animations.
  • Do not call an optimization successful without a repeatable before/after measurement.

References

Read these only when relevant:

  • references/tool-selection.md — read when the task needs a deeper mapping from symptoms to Instruments templates, MetricKit, XCTest metrics, signposts, or production diagnostics.
  • references/time-profiler-and-hangs.md — read when the task involves Time Profiler, Hangs, main-thread freezes, blocked threads, lock contention, synchronous I/O, CPU spikes, or stack interpretation.
  • references/animation-hitches-and-swiftui.md — read when the task involves animation hitches, scrolling hitches, dropped frames, Core Animation, SwiftUI Instrument, repeated view updates, frame budget, or UI responsiveness traces.
  • references/memory-leaks-and-allocations.md — read when the task involves Allocations, Leaks, Memory Graph Debugger, VM Tracker, memory growth, retain cycles, caches, decoded images, or allocation churn.
  • references/network-disk-power.md — read when the task involves slow networking, duplicated requests, caching behavior, disk reads/writes, persistence stalls, excessive logging, background work, wakeups, battery drain, or thermal pressure.
  • references/xctest-metrickit-organizer.md — read when the task involves XCTest performance tests, XCTApplicationLaunchMetric, CI regression guards, MetricKit payloads, Xcode Organizer, production regressions, device cohorts, p95, or p99.
  • references/signposts-and-scenarios.md — read when the task needs a reproducible scenario, signpost instrumentation, signpost naming, custom trace regions, before/after comparison, or a profiling report template.

Output expectations

For most profiling tasks, respond with:

## Symptom

...

## Profiling path

Primary:
Secondary:
Why this tool:

## What to inspect

...

## Likely hypotheses

1. ...
2. ...

## Suggested fixes or next steps

...

## Verification

...

For code reviews, respond with:

## Summary

...

## Findings

### 1. Finding title

Risk:
Why it matters:
Suggested change:
How to verify:

## Profiling checklist

...

For traces, reports, logs, MetricKit payloads, Organizer screenshots, or Instruments screenshots, respond with:

## What the data shows

...

## Strongest signal

...

## Likely cause

...

## What is not proven yet

...

## Next step

...

## Verification

...

Final review checklist

Before finalizing a performance answer, check:

  • Did you identify the user-visible symptom?
  • Did you choose the tool based on the symptom?
  • Did you state what evidence is available and what is missing?
  • Did you separate local traces from production metrics?
  • Did you account for device, OS, build configuration, data set, and run count?
  • Did you avoid claiming certainty without evidence?
  • Did you recommend real-device Release profiling when relevant?
  • Did you suggest signposts for app-specific operations when useful?
  • Did you propose one focused fix or next inspection step at a time?
  • Did you include a re-measurement step?
  • Did you suggest XCTest, MetricKit, or Organizer for regression protection when appropriate?
  • Did you avoid broad rewrites unless evidence supports them?

版本历史

  1. 1.0.0 GitHub ↗

当前收录版本

0.0.1

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值95/100

亮点

  • 覆盖 iOS 性能分析全链路:从症状识别、工具选择、证据收集、解释到修复验证,提供完整闭环工作流。
  • 精准区分性能分析技能与深度领域技能(如启动、SwiftUI、并发),避免功能重叠,提升路由准确性。
  • 强调‘证据优先’原则,提供可操作的检查清单与验证机制,显著提升开发者性能优化效率。
触发精准95/100

亮点

  • 触发词精准覆盖 Instruments、MetricKit、XCTest、卡顿、内存、网络、功耗等核心性能信号。
  • 明确界定使用与不使用场景,边界清晰,有效防止误触或漏触。
  • description 位置正确,内容完整,无截断或错位。
结构规范95/100

亮点

  • 结构完整,包含从原则、检查、工具选择、工作流到输出期望的全套规范。
  • 步骤清晰,有明确的出口条件与验证机制,含端到端示例。
  • frontmatter 完整,文档长度适中,排版规范。
执行可靠95/100

亮点

  • 工具来源明确,均为 Apple 官方性能分析工具,参数使用正确。
  • 覆盖主要异常场景(如 Debug/Release 差异、Simulator/Device 差异、证据缺失)。
  • 强调 re-measure 与验证,确保优化有效性,避免无效操作。
证据可验 (前四项均值)95/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

来源文档未说明。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。