~/talk

Understanding Render Loop to optimise SwiftUI

Talkat try! Swift Tokyo 2025 · 2025-04-09..04-11· [swift, web-performance]
slides:none on file

Explains SwiftUI's render loop phases (event, view update, render, display) and shows a real animation that hitches until adding the drawingGroup modifier, which flattens views into bitmaps. For clouds that fixes lag and cuts CPU from >100% to ~33% while raising memory from ~11MB to ~57MB; for continuously regenerated, animated petals drawingGroup backfires, pushing CPU toward 100% and memory from ~73MB to ~142MB, so use selectively.

AI-written summary · about

  1. 0:00Introduction
  2. 1:26Render loop in SwiftUI
  3. 2:49Event phase and state
  4. 4:16View update phase
  5. 5:43Render phase and display
  6. 6:25Render loop in action
  7. 8:10Hitches and frame drops
  8. 9:35Laggy animation demo
  9. 10:59Analyzing laggy code
  10. 13:30Fix lag with drawing group
  11. 14:55Performance comparison after optimization
  12. 16:18Cherry blossom breakdown
  13. 18:25Petals performance drop
  14. 19:49When not to use drawing group
  15. 21:36Recap and key takeaways
  16. 22:17Resources
~/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.