跳到正文
TakoAPI
返回技能列表

swiftui-performance-audit

由 steipete 提供

iOS & macOS Development
2.5k下载量由 clawskills.sh 提供
3星标
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Audit and improve SwiftUI runtime.

描述

该技能的功能

Audits SwiftUI view performance through code review and guided Instruments profiling. Covers view invalidation storms, unstable list identities, heavy body computations, layout thrash, and image decoding issues. Produces a prioritized issue list with concrete code fixes and before/after metrics when traces are available.

Combines static code review with step-by-step Instruments guidance so performance issues are caught even when the root cause isn't obvious from symptoms alone.

何时使用

  • Diagnosing janky scrolling in a SwiftUI list
  • Finding CPU spikes during complex SwiftUI animations
  • Reducing excessive view body re-evaluations in a feed
  • Catching expensive formatter allocations inside body
  • Profiling memory peaks in an image-heavy SwiftUI screen

示例工作流

输入

User asks: 'My SwiftUI list scrolls at 30fps and CPU spikes during scrolling. Here is my view code.'

智能体
  1. 1

    Reviews the provided view code for known SwiftUI anti-patterns

  2. 2

    Identifies sorted collections computed inside body on every render

  3. 3

    Detects unstable ForEach identity using id: \.self on mutable values

  4. 4

    Recommends precomputing sorted data and using stable IDs

  5. 5

    Guides the user to capture a SwiftUI Instruments trace if code fixes are insufficient

输出

A prioritized list of root causes with specific code changes and an optional Instruments profiling walkthrough

安装

clawhub install steipete/swiftui-performance-audit

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接