whitescent / Mastify

A Mastodon client built with Jetpack Compose [WIP]
https://play.google.com/store/apps/details?id=com.github.whitescent.mastify
GNU General Public License v3.0
155 stars 8 forks source link

Stuttery timeline when loading #72

Closed LucasGGamerM closed 3 months ago

LucasGGamerM commented 4 months ago

Mastify lags a lot when scrolling, which I believe is due to the image loading part of the app doing networking operations IO on the UI thread, causing the app to stutter.

A possible solution would be using callbacks to only render the timeline and the subsequent images when they are fully loaded

whitescent commented 4 months ago

Hi @LucasGGamerM thanks for ur research and testing, The image loading part is basically done using Coil, and the AsyncImage in Coil should be in the IO thread by default, so I don't think the problem should be here.

Did you test in the debug version or in the release version?, the performance of the list is completely different in the release version compared to the debug version, this is due to Jetpack Compose, if there is a performance issue in the release, it is generally due to recomposition.

I've tested list performance in the release version, and it should generally be fine (based on the values in the chart below)

image

LucasGGamerM commented 4 months ago

I can confirm that images are not the source of the issue.

After testing, I can attest that once the cache is cleaned, the app get so stuttery it's annoying.

I am looking though the code to see what things can be done about it

LucasGGamerM commented 3 months ago

It seems like the issue is totally gone! I don't know what you did that made that happen, but it's awesome now