How to instrument code like you mean it
summary
Use Instruments to find exact causes: Core Animation shows color blended layers, misaligned images and offscreen rendering — fix by making UIGraphicsImageRenderer opaque, draw at natural pixel size, and set layer.shadowPath to avoid extra passes. Allocations reveals retained view controllers from scheduled timers — invalidate timers to break the retain cycle. Prefetching collection view cells removes jank and raises frame rates to ~110 FPS. A naive multithreaded image loader slows from 2.359s to 6.385s; switching from imageNamed cache to file loading cuts it to 0.471s using Time Profiler and system trace.
AI-written summary · about
