Fixing Image Performance for The Worst iPhone
summary
Rebuild of a feed that fetches ~200 high‑res images per page to run on an iPhone 6S Plus (2 GB RAM) shows why naive URLSession prefetching and synchronous URLCache hits choke CPU and memory: 10 projects took ~18.6s and caused OOM. Solution: keep an in‑memory resized cache, fetch+resize off the network thread, limit workers with NSOperationQueue maxConcurrentOperationCount = 3, store a 25% preview and overlay full res when ready. Result: smooth scrolling, avoided OOM, and near‑60 FPS on the worst phone.
AI-written summary · about
chapters (11)
- 0:00Intro
- 1:03The problem
- 2:12Context
- 5:02Run Loop Main Thread
- 8:40Prefetch
- 16:53Resize
- 20:00Thread Problems
- 23:17Memory Problems
- 26:32Cache Issues
- 30:30Why it works
- 31:51What didnt work
related talks
19mOptimising image heavy applications
25mThe Life of an Image on iOS
24mWrangling the CPU iOS Performance in the Facebook App
14mReducing Image Memory Consumption in 10 Minutes
42mCloud and Mobile App Performance
18mNeed for Speed: How XO Group Optimized their Image Loading Time on The Knot Mobile App
42mTuning your app using Xcode's Instruments
30mFrom Slow to Flow: Tips for Accelerating Your App Performance
