~/talk

Compose Performance: Hunting for unnecessary recompositions

Talkat droidcon Berlin 2023 · 2023-07-05..07-07· [android, frontend-architecture]
links:none on file
slides:none on file

Unnecessary recompositions cause real jank on weaker devices and can be hunted down with concrete fixes and tools: use Layout Inspector to see actual vs skipped recompositions, and generate compose compiler reports (composables.txt, classes.txt) in release builds to find unstable inputs. Practical fixes shown include caching boolean results with derivedStateOf, switching modifier updates to lambda-based graphicsLayer or remember, replacing mutable Lists with kotlinx immutable collections or marking small models @Stable; after these changes skipped counts disappear and recompositions drop to only the meaningful ones.

AI-written summary · about

  1. 0:00Introduction
  2. 0:58Compose phases and recomposition
  3. 3:37Checking for recompositions
  4. 6:11Example one: State read
  5. 8:18Example two: Modifier usage
  6. 11:53Restartable and skippable concepts
  7. 15:23Example three: Stabilize unstable part one
  8. 20:21Compose compiler matrix explained
  9. 23:33Fixing unstable parameters
  10. 30:12Example four: Stabilize unstable part two
  11. 32:43Final advice and conclusion
~/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.