Skip to content

perf: smoother navigation and fewer full-app recompositions - #765

Open
Sahank29 wants to merge 6 commits into
mainfrom
perf/smoother-2
Open

Sahank29 wants to merge 6 commits into
mainfrom
perf/smoother-2

Conversation

@Sahank29

Copy link
Copy Markdown
Contributor

Keeps Home alive under pushed screens, stops route and theme changes from recomposing the whole app, trims glass GPU work during slides and extends the baseline profile, so opening and closing pages no longer stutters (also fixes the current compile errors on main).

…ositions

Back from any page rebuilt the whole Feed in one frame because NavHost
disposed Home. Home now stays composed under the NavHost and is only
skipped from layout while covered.

Also:
- theme only rebuilds when a theme setting changes; any unrelated
  DataStore write used to recompose the whole app
- Library no longer flips isLoading on every resume
- page transitions slide instead of fading the full screen
The mini player clearances and the glass backdrop were static
CompositionLocals whose values follow the route and the player sheet.
A static local that changes recomposes its whole subtree, so every
navigation and every player open recomposed every screen, Home rows
included. Make them dynamic so only their readers recompose.

Home is also measured while covered and only skipped at placement, so
coming back is a re-place instead of a full remeasure.
…ayers

The bottom bar was rebuilt every time Home came back; it now stays
composed and is only left unplaced on other screens.

The Feed hero and spotlight artwork used Modifier.alpha, which made the
GPU render each full-width card offscreen on every frame Home was drawn.
Use AsyncImage's paint alpha instead.
The LinkageError retry branch referenced an undefined retryError, and two
companion markers exposed the private QueuedPcm type.
Adds the hot and startup methods recorded on device that the existing
wildcards and the Compose library profiles did not cover (data, playback,
DataStore, Coil, coroutines, navigation). Cold start on a fresh install
drops about 8%.
The liquid bar re-rendered the whole pager offscreen every frame to
refract it, including during the back slide. The bar and its source now
appear when Home is the only screen showing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant