Text is the most expensive composable you use without thinking
Layout measures text to resolve constraints, and a changing style invalidates the cache.
We use Google Analytics to see which pages help people. No ads, no profiles. Privacy Policy
27 posts
Layout measures text to resolve constraints, and a changing style invalidates the cache.
A computed value read in composition invalidates on every change of its source. derivedStateOf narrows it to the result.
A bitmap costs width × height × 4 bytes in memory regardless of its file size. Decoding at display size, choosing the right config and budgeting the cache are what keep an image-heavy app from being reclaimed.
It is scoped to a composition and keyed by its arguments. A missing key gives stale state; a wrong one recomputes every frame.
Compose re-executes functions whose inputs changed. An unstable parameter means all of them.
Android shrinks against a runtime already on the device. iOS links yours in.
A Kotlin List becomes an NSArray by conversion, not by reference.
First paint waits on a wasm binary and a font, which no mobile profile shows.
Recomposition scope is set by where a value is read, not where it is declared. Most Compose performance problems are a read placed higher than it needed to be.
Battery cost is attributed at app level and spent at feature level. Measure the delta against a control run, and treat thermal state as part of the result.
Cold start is a different system from steady state, not the same one measured twice. Treat warmth as a resource with a lifecycle, and measure both numbers.
Streaming output updates state far faster than a normal screen. Narrow what reads the changing value, and let the smallest possible scope recompose.