I have to display a stream of data (at least 1000 ...
# compose
b
I have to display a stream of data (at least 1000 items), every
add
to
ModelList
reloads the view, no? Because of that while the items are being loaded the app lags quite a lot, do I have to implement something like a pagination myself or is there a way to optimize such thing out of the box?
l
Right now there isn’t a component which handles this situation, from what they said, is under development
l
yeah right now you’d need to implement this yourself
b
okay well will leave it as it is if that's the case
l
What if you
.addAll()
instead of
add()
every item, is the composition re-triggered on every element?
Or just once with a big lag? 😄
b
@Luca Nicoletti it's a rxjava flowable that collects items from ~20 web sources, already tried to batch it but it didn't help too much
l
regardless if you use add vs addall, it should only cause a single recomposition on the next frame. @Model observation doesn’t trigger synchronous recompositions
so it is already debounced to some degree (ie, roughly ~16ms)
but for lots of items you’ll still want to do something different
i would build something out of PagedList, not ModelList, for this use case fwiw
r
Yeah, something to handle this easily is under development