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
24 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.
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.
Comparing a local model to an API is not a race between two averages — it is tail latency, failure rates, and how often one task crosses the boundary.
Compose renders in three phases. Where you read state decides which phase invalidates, and moving a read from composition into layout or draw is the single highest-leverage performance change available.
Compose does not re-run your whole screen when state changes. It re-runs the smallest restartable scopes that read the changed value. Once you can see those scopes, recomposition stops being mysterious.