~/talk

Drawing without pain and recomposition

Talkat droidcon San Francisco 2024 · 2024-06-06..06-07· [android, web-animation]
links:none on file
slides:none on file

Shows concrete fixes that cut needless recompositions and allocations by moving reads out of composition into layout or drawing phases, with working examples: replacing alpha tied to state with graphicsLayer modifier eliminates per-frame recompositions, swapping animateDp-backed height for a layout-based read or a custom height-state modifier removes animation churn, and drawing backgrounds via drawBehind/drawWithCache avoids composition. Memory wins include replacing per-frame brush creation that caused 1363 linear gradients with canvas.translate caching, and avoiding boxing that produced 79k offsets by using the native canvas float-array path.

AI-written summary · about

  1. 0:00Jetpack Compose optimizations
  2. 3:55Jetpack Compose phases
  3. 6:00Recomposition triggers and best practices
  4. 8:32State reads in phases
  5. 11:21Defer state reads to reduce recomposition
  6. 13:30Height animations in Compose
  7. 16:49Reduce recomposition on background changes
  8. 19:45Phase changes for performance
  9. 21:55Lottie animations in Compose
  10. 24:30When optimization is unnecessary
  11. 25:14Memory optimization with shimmer
  12. 28:47Particle system animation challenges
  13. 31:42Reduce memory allocations in canvas
  14. 35:16Summary
~/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.