Performance in Compose:Lessons learned from Lazy layouts
summary
Updating to the latest Compose yields measurable wins—benchmarks show around 25% scroll frame-time improvement since recent releases—and switching debug APKs to release gives roughly a 4x startup speedup; enabling R8 and baseline profiles removes JIT pauses. Moving frequently changing state reads out of composition into later phases using modifier.layout and drawWithContent cuts recompositions (measure is ~3x cheaper than composition; draw can be ~10x cheaper for backgrounds). DerivedState helps only when results are stable; refactoring to a single state holder and MutableStateFlow reduced allocations and gave about a 9% frame-time improvement.
AI-written summary · about
chapters (7)
- 0:00Introduction to Compose performance
- 1:09Evolution of Compose optimization
- 3:00Update to latest Compose version
- 6:53Mastering frame phases in Compose
- 17:17Derived state best practices
- 25:12Optimizing initial composition
- 32:38Key takeaways and future work
related talks
21mPerformance best practices for Jetpack Compose
21mMore performance tips for Jetpack Compose
36mOptimizing Render Performance of Jetpack Compose
40mBoosting Compose UI from Sluggish to Snappy
38mJetPack Compose Performance Tips & Tricks
54mOptimizing Render Performance of Jetpack Compose
44mBoosting Compose UI from Sluggish to Snappy
45mBoosting Compose UI from Sluggish to Snappy
