swift-performance-optimization-skill

Featured

Use when investigating measured Swift or Apple-platform regressions in CPU, memory, launch, scrolling, animation hitches, image processing, energy, networking, or concurrency, or when designing performance tests and Instruments experiments. Do not use for speculative micro-optimization, ordinary refactoring, or a functional bug without performance evidence.

Code & Development 436 stars 36 forks Updated today MIT

Install

View on GitHub

Quality Score: 89/100

Stars 20%
88
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Swift Performance Optimization Skill Optimize from evidence. Preserve behavior, accessibility, data correctness, and lifecycle safety while changing performance characteristics. ## Baseline The copy-ready examples use Xcode 16, Swift 6 language mode with strict concurrency, and iOS 17. Most principles apply to older targets; verify each API against the app's actual minimum. Material from the OS 27 development cycle is beta relative to stable Xcode 26.6 and requires an explicit request, beta labeling, stable fallback, and availability gate. ## Measurement workflow 1. Define a user-visible symptom and a reproducible scenario. 2. Record device, OS, build configuration, dataset, thermal state, and network conditions. 3. Measure an optimized Release build on representative hardware. Simulator-only timing is not release evidence. 4. Select the instrument that answers the hypothesis. 5. Save a baseline trace or metric, change one variable, then repeat the same scenario. 6. Confirm that the bottleneck moved and no memory, energy, correctness, or accessibility regression appeared. 7. Add a regression threshold where the workload is stable enough to automate. Useful tools include: | Symptom | First evidence source | |---|---| | CPU-bound work | Time Profiler; inspect heavy stacks and self time | | SwiftUI update cost | SwiftUI instrument plus Time Profiler | | Scroll or animation stalls | Animation Hitches, Core Animation, signposts | | Growth or leaks | Allocations, Leaks, Me...

Details

Author
termio-sh
Repository
termio-sh/termio
Created
3 months ago
Last Updated
today
Language
Swift
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category