Compose Performance & Stability
UI › Compose UI
Skipping recomposition via stability, strong skipping, deferred reads, and lifecycle-aware state.
Performance is one of the most common senior Compose interview areas because slow lists and jank usually trace back to unnecessary recomposition. Interviewers probe whether you understand stability inference, what Strong Skipping Mode changed in Compose Compiler 2.0, and how deferred state reads, derivedStateOf, and lifecycle-aware collection keep recomposition cheap. Expect to reason about why a composable recomposes and how to fix it with concrete APIs and tools.
What this covers
- What makes a type stable vs unstable and how the compiler infers it (@Stable, @Immutable)
- Why List/Map/Set and types from non-Compose modules are treated as unstable, and how to fix them
- What Strong Skipping Mode (Compiler 2.0) changes about skippability and lambda memoization
- Deferring state reads with lambda-based modifiers and derivedStateOf to narrow recomposition scope
- collectAsStateWithLifecycle vs collectAsState and why lifecycle awareness matters
- Debugging recomposition with compiler reports, Layout Inspector recomposition counts, and benchmarks
Study this topic
- Compose Performance & Stability explained: the guided lesson
- 14 practice quiz questions
- 9 revision flashcards
- Compose Performance & Stability interview questions and answers