~/talk

Fixing Image Performance for The Worst iPhone

Talkat SwiftLeeds 2024 · 2024-10-08..10-09· [ios, web-performance]
speakerdeck:avielg
slides:none on file

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

  1. 0:00Intro
  2. 1:03The problem
  3. 2:12Context
  4. 5:02Run Loop Main Thread
  5. 8:40Prefetch
  6. 16:53Resize
  7. 20:00Thread Problems
  8. 23:17Memory Problems
  9. 26:32Cache Issues
  10. 30:30Why it works
  11. 31:51What didnt work
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.