iOS Performance
Priority: P0
Implementation Workflow
- Profile with Instruments — Regularly use Allocations and Leaks to detect memory issues. Use Time Profiler for CPU stalls.
- Reuse cells — Always use
dequeueReusableCelland keepcellForRowAtlightweight. - Cache images — Use
SDWebImageorKingfisherfor remote assets.AsyncImagelacks caching for lists. - Offload to background — Move parsing, encryption, and heavy computation off Main thread using GCD or Tasks.
- Enable strict warnings — Set
SWIFT_TREAT_WARNINGS_AS_ERRORSin Release builds. - Run static analysis — Use Xcode's "Analyze" (Product > Analyze) to catch logic errors.
See background processing and cell reuse examples
Anti-Patterns
- No Main-thread Processing: Offload parsing/processing to background using
Task.detachedor GCD - No Manual Cache Clears: Let system handle low-memory via
applicationDidReceiveMemoryWarning - No Retain Cycles: Use Leaks instrument frequently during development