swiftui-performance

Diagnose SwiftUI rendering issues using Instruments profiling and targeted refactors.

Updated May 10, 2026
One-click install
npx skills add https://github.com/FelixRauch/medat-figuren --skill swiftui-performance-felixrauch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-performance
Source: https://github.com/FelixRauch/medat-figuren/tree/main/.agents/skills/swiftui-performance
Command: npx skills add https://github.com/FelixRauch/medat-figuren --skill swiftui-performance-felixrauch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you diagnose and fix SwiftUI performance issues like slow rendering, janky scrolling, excessive CPU/memory use, and unnecessary view updates that waste work per frame.

Core Features & Use Cases

  • Workflow Decision Tree: Quickly routes you based on whether you can share code or only symptoms, so you can start the right troubleshooting path.
  • Instruments-Guided Profiling: Provides step-by-step guidance to collect SwiftUI timeline data and Time Profiler evidence in Release builds (ideally on real devices).
  • Practical Root-Cause Analysis: Targets common SwiftUI culprits such as view invalidation storms, unstable identity, heavy computation in body, layout thrash, large image handling, and inefficient list/list identity patterns.
  • Concrete Remediation Steps: Recommends targeted refactors like narrowing observable dependency scope, stabilizing ForEach identity, moving heavy work out of body, and verifying improvements with re-measurements.
  • Optimization Guardrails: Offers specific “do/don’t” patterns for identity/lifetime, lazy loading, state/observation scope, and profiler verification.

Quick Start

Share the specific SwiftUI view or feature code plus the symptoms (what interaction is slow, and how it reproduces), and then ask the Skill to recommend the most likely bottlenecks and concrete remediation steps to apply before profiling.

Frequently Asked Questions about swiftui-performance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix slow SwiftUI rendering and scrolling jank?

Fix slow SwiftUI rendering by identifying causes of jank like view invalidation storms, unstable identity, and heavy computation in the body. Diagnose these issues using a code-first triage path and profiling evidence.

How do I profile SwiftUI view update patterns in Instruments?

Profile SwiftUI view update patterns in Instruments by collecting timeline data and Time Profiler evidence from Release builds on real devices. This workflow helps pinpoint expensive body computation and layout thrash.

Why does my SwiftUI ForEach list perform poorly during user interactions?

SwiftUI ForEach list performance suffers during interactions from unstable identity and inefficient list patterns. Stabilizing ForEach identity and narrowing observable dependency scope targets these root causes to reduce wasted work per frame.

What is the best way to troubleshoot excessive CPU usage in SwiftUI apps?

The best way to troubleshoot excessive SwiftUI CPU usage is a workflow applying root-cause prioritization to view update patterns and image layout costs. Verify improvements through targeted refactors and a re-measurement verification loop.

Can I diagnose SwiftUI layout thrash without sharing source code?

You can diagnose SwiftUI layout thrash from symptoms alone by using a workflow decision tree that routes troubleshooting based on whether you can share code or only interactions. Evidence collection via Instruments remains required for root-cause confirmation.

What are common SwiftUI performance pitfalls with lazy loading and observation scope?

Common SwiftUI performance pitfalls with lazy loading and observation scope include broad state observation triggering unnecessary updates and inefficient lazy loading patterns. Optimization guardrails offer specific do and don't patterns to prevent these issues.