Skip to content

perf(home): smoother vertical scrolling in Netflix-style Home - #830

Merged
ProdigyV21 merged 3 commits into
ProdigyV21:mainfrom
silentbil:feature/netflix-scroll-smoothing
Oct 26, 2026
Merged

ProdigyV21 merged 3 commits into
ProdigyV21:mainfrom
silentbil:feature/netflix-scroll-smoothing

Conversation

@silentbil

@silentbil silentbil commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Smoother vertical scrolling in the Netflix-style TV Home.

Moving down used to resize every card of two rails at once: the row being left shrank while the row being entered grew, along with their headings and descriptions. That re-measured the whole list on every frame of the vertical scroll.

  • The row being left now keeps its expanded layout while the scroll carries it out the top, then collapses in one frame once it is off screen. Moving up is unchanged, since the row being left stays visible below.
  • Row headings scale with graphicsLayer instead of animating their font size, so the text is no longer re-measured each frame.
  • A row held expanded while it leaves no longer moves the channel preview.
  • Cards get their morph size at layout time instead of reading the animated width and height in composition, so every card of the two morphing rows is re-measured each frame instead of recomposed. MediaCard gains fillArtworkHeight so its artwork follows the height the parent gives it.

Testing

Release (R8) builds on a Xiaomi Mi Box 4 (Android 9). Frame times come from dumpsys gfxinfo over 20 Down presses from the top of Home; the two builds were alternated, 3 runs each, on the same rows.

1. Keep the leaving row expanded (first commit) vs main, one press every ~1.4 s and every ~0.9 s:

~1.4 s: main ~1.4 s: branch ~0.9 s: main ~0.9 s: branch
Median frame 15 ms 16 ms 17 ms 18 ms
90th percentile 54 ms 48 ms 57 ms 53 ms
95th percentile 77 ms 60 ms 82 ms 58 ms
99th percentile 133 ms 81 ms 113 ms 82 ms

2. Morph size at layout time (ca7ac54d) vs the first commit, one press every ~0.5 s:

first commit + ca7ac54d
Janky frames 51% 46%
Median frame 21 ms 17 ms
90th percentile 104 ms 76 ms
95th percentile 134 ms 102 ms
99th percentile 194 ms 131 ms

Together, the stutters that are visible on the box (90th–99th percentile) are roughly a quarter to a third shorter at each step. Unit tests (Netflix home and card components) and NetflixVerticalNavigationDeviceTest pass.

Moving down in the Netflix layout resized every card of two rails at once
(the row being left shrank while the row being entered grew), plus their
headings and descriptions, re-measuring the whole list on each frame of
the vertical scroll.

The row being left now keeps its expanded layout while the scroll carries
it out the top and collapses in one frame once off screen. Moving up is
unchanged, since the row being left stays visible below. Row headings
scale with graphicsLayer instead of animating their font size.
@github-actions github-actions Bot added the area: android Changes to the Android app or Gradle build label Oct 24, 2026
@silentbil
silentbil marked this pull request as draft October 25, 2026 04:45
Each card read its animated width and height in composition, so every
card of both morphing rows recomposed (MediaCard included) on every frame
of the 220 ms row morph. The cards now get their target size and a layout
modifier sizes them to the running animation values, so a frame only
re-measures them. MediaCard gains fillArtworkHeight so its artwork follows
the height the parent gives it.

Measured on a Mi Box 4 (release build, one Down press every ~0.5 s):
90th-percentile frame time 104 -> 76 ms, janky frames 51% -> 46%.
@silentbil
silentbil marked this pull request as ready for review October 25, 2026 13:07
@silentbil
silentbil requested a review from ProdigyV21 October 25, 2026 16:10
@ProdigyV21

Copy link
Copy Markdown
Owner

I think we can also make horizontal smoother, especially when holding down right or left it can be improved a lot, think you can do that as well?

@silentbil

Copy link
Copy Markdown
Collaborator Author

I think we can also make horizontal smoother, especially when holding down right or left it can be improved a lot, think you can do that as well?

@ProdigyV21 i dont have any issues in horizontal scrolling, i checked old devices too.
this is the first phase, on next one i want to upgrade compose which suppose to improve a lot

@ProdigyV21
ProdigyV21 merged commit 23d0b13 into ProdigyV21:main Oct 26, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: android Changes to the Android app or Gradle build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants