Optimising UI in Jetpack Compose
summary
Shows a real bug: an auto-resize Text that keeps reducing font size until it loops into continuous recomposition, and fixes by breaking UI into smaller composables so only the follow button or post list recomposes. Demonstrates use of remember(key=...) so cached values don’t reset, uses launchEffect/disposableEffect (with a 500 ms debounce and cancellable jobs) to manage side effects, and inspects counts with Layout Inspector and a Compose compiler metrics HTML report run in release to find skipable vs restartable composables.
AI-written summary · about
chapters (11)
- 0:00Jetpack Compose UI optimization intro
- 1:14Composable functions
- 4:49Composer and recomposition
- 11:20Fixing recomposition loops
- 14:12Breaking UI into composables
- 17:26State hoisting best practices
- 21:01Side effects in Compose
- 26:38Avoid recompositions with remember
- 33:28Stable state for performance
- 38:39Measure Compose performance
- 44:25Q&A
related talks
31mDesigning Media Friendly Jetpack Compose Components
21mPerformance best practices for Jetpack Compose
44mBoosting Compose UI from Sluggish to Snappy
39mRe-Compose your UI: building an atomic design library
18mCompose: Implementing responsive UI for larger screens
43mBuilding Accessible Apps with Jetpack Compose
49mBuilding an Android UI using declarative programming in Jetpack Compose
36mPractical implementations of powerful UI expressions using Jetpack Compose
