Posts

Showing posts from 2026

Mastering Compose Performance: Stability, Reports, and Profiling

Performance in Jetpack Compose is built on Stability —the compiler's ability to know if data has changed. If the compiler isn't sure, it re-runs your UI code "just in case," leading to unnecessary recompositions and potential lag. 1. Stable vs. Unstable Types The Compose compiler categorizes every parameter passed into a function to determine if a Composable can be "skipped." Type Description Examples Stable Immutable types or those that notify Compose of changes. Compose skips these if .equals() is true. String , Int , Boolean , @Stable objects, State<T> . Unstable Types that might change internally. Compose always recomposes these to ensure UI accuracy. Standard List , Set , Map , or classes with var properties. Why i...