Hi, we are using Compose for a Big Screen Applicat...
# compose
m
Hi, we are using Compose for a Big Screen Application however the scroll performance on the
LazyVerticalGrid
is really bad. Our Composables are pretty simple. We assign a key to every item and have only one
contentType
yet it's still lagging noticeably. For the scrolling we are using
LazyGridState#animateScrollToItem
(no real difference when using
LazyGridState#animateScrollBy
or a release build with R8 enabled). Any idea how the scroll performance can be improved or is this just like it is with compose these days? Following a video showing a "full page" scroll. (1.2.1 of compose-ui is used)
đź‘€ 1
z
Could you please share some code that makes up the vertical grid?
a
Besides the grid itself, the parents & modifiers can be involved. took me a awhile to find a similar looking problem, scrolling was slow because because a parent element had a nestedscroll modifier implemented with an inline "object : " which was being created on every recomposition and causing a lot of extra relayout to run on the whole lazy list, had to add a remember on that object and it was fixed.
a
Try using the RecomposeHighlighter modifier to debug whether the items are getting recomposed every frame or whenever you scroll, they shouldn’t be doing that if they are. Another thing is to try with a release build.