Compose performance is one question asked in four places
Compose performance work reduces to knowing which of composition, layout and draw is being invalidated, and why. The diagnostic order matters more than any individual optimisation.
We use Google Analytics to see which pages help people. No ads, no profiles. Privacy Policy
129 posts
Compose performance work reduces to knowing which of composition, layout and draw is being invalidated, and why. The diagnostic order matters more than any individual optimisation.
Compose's drag-and-drop moves ClipData between sources and targets, including across apps. Reordering a list is a different problem with a different solution, and conflating them is why reorder implementations get complicated.
animate*AsState holds its value in the composition. A key change starts it over.
A testTag is invisible to a screen reader. A contentDescription is not.
Compose's focus system handles keyboard, D-pad and accessibility navigation. The APIs are small, but modifier order matters, and a form with no focus handling is unusable on any device without a touchscreen.
NestedScrollConnection gives parents four chances to consume scroll deltas around a child. Choosing the wrong one is why collapsing headers collapse late, and why same-axis nesting misbehaves.
Multi-touch gestures produce pan, zoom and rotation simultaneously. The centroid — the point between the fingers — is what makes the transform feel anchored, and ignoring it is the most common photo-viewer bug.
Hand-rolled swipe gestures compare a distance threshold and ignore velocity, which is why a fast flick feels wrong. AnchoredDraggableState models discrete positions and settles between them using both distance and speed.
Modifier.clickable adds accessibility semantics, focus, keyboard activation, ripple and a minimum touch target on top of tap detection. Reaching for detectTapGestures instead silently drops all of it.
pointerInput gives you a coroutine scope over raw pointer events. Understanding that gestures are suspending loops rather than callbacks explains the whole API, including why the key parameter matters more than it looks.
Compose's accessibility checks catch touch targets, contrast and missing labels automatically. The failures they cannot detect — wrong labels, bad order, gesture-only actions — need a person, and knowing the split makes both cheaper.
Screen readers traverse in layout order, which breaks when a floating action button, a sticky header or a two-column layout puts visual priority somewhere else. Traversal groups and indices reorder without moving anything.