Boosting Compose UI from Sluggish to Snappy
summary
A Compose card stack that initially misses frame deadlines by ~50–60 ms gets rebuilt as a sandboxed “Janky Tinder” and profiled with macrobenchmark frame timing, system traces augmented by the Compose runtime tracing library, Peretto and the layout inspector. Fixes include measuring only visible cards (reducing thousands of measures to three), switching animated modifiers to lambda-backed graphicsLayer and deferring state reads to lambdas to cut recompositions, replacing LazyRow/MaterialCard with simple Row/Box, and enabling compiler strong skipping after inspecting compose compiler metrics; end-to-end latency falls into the high teens.
AI-written summary · about
chapters (19)
- 0:00Compose UI performance issues
- 1:07Janky Tinder challenge
- 2:10Quantifying jank with macrobenchmarks
- 5:01Diagnosing with system trace
- 9:40Excessive card instances with layout inspector
- 10:42Fixing measure phases in layouts
- 13:09Recomposition spikes with layout inspector
- 14:54Compose performance book insights
- 18:46Lambda modifiers and state reads
- 20:13New features and regression risks
- 22:40Massive regression with Perfetto
- 23:41Simpler composables for LazyRow
- 28:18Compose compiler metrics
- 31:48Strong skipping for recompositions
- 34:12Final performance validation
- 34:55Recap of fixes
- 37:20Macrobenchmark testing best practices
- 38:03Baseline profiles impact
- 39:06Performance debugging tools
related talks
45mBoosting Compose UI from Sluggish to Snappy
44mBoosting Compose UI from Sluggish to Snappy
37mPerformance in Compose:Lessons learned from Lazy layouts
21mMore performance tips for Jetpack Compose
21mPerformance best practices for Jetpack Compose
35mEnhancing Jetpack Compose App Performance:Tools, Strategies and Optimizations
32mFrom Debugging to Real-World Tuning: A Practical Guide to Compose Performance
28mCompose at Scale: Stop Unnecessary Recomposition
