Understanding Recomposition Performance Pitfalls
summary
Explains how recomposition works (snapshot observers record state reads, recomposer observes writes, composition restarts) and shows a practical profiler: composition tracing highlights frame overruns and which composables ran. Recommends deferring or moving state reads into layout/draw or deeper children, using lambdas to avoid gratuitous captures, using derivedStateOf (+ mutation policy) to collapse noisy updates, and checking compiler outputs like classes.txt / composables.txt to find unstable types or apply @Immutable/@Stable annotations.
AI-written summary · about
chapters (10)
- 0:00Introduction to recomposition
- 2:59How recomposition works
- 7:56Practical optimization tips
- 13:11Derived state optimization
- 15:57Reducing state scope
- 18:27Understanding stability
- 23:51Stability best practices
- 25:37Lambdas and performance
- 31:00When to optimize
- 32:43Q&A session
related talks
28mCompose at Scale: Stop Unnecessary Recomposition
49mWhat does Recomposition mean to your app?
55mWhat does Recomposition mean to your app
38mWhat does Recomposition mean to your app?
45mMastering Recomposition: Optimizing State Changes for Efficient UI
34mCompose Performance: Hunting for unnecessary recompositions
41mDemystifying the Compose Runtime & Compiler
38mJetPack Compose Performance Tips & Tricks
