vitorpamplona / amethyst

Nostr client for Android
MIT License
1.17k stars 158 forks source link

Smooth Scrolling #675

Open Yonle opened 1 year ago

Yonle commented 1 year ago

So every notes is only loaded once it was visible on screen. Once it was outside of the feed, That notes is gone until it was visible on screen again.

This probably could be fixed by caching the timeline feeds / notes to achieve the smooth scrolling experience, and probably only load new nostr notes once user hit to top, or after leave from thread screen.

Yonle commented 1 year ago

So every notes is only loaded once it was visible on screen. Once it was outside of the feed, That notes is gone until it was visible on screen again.

If not because of this, Probably due to the factor of constant rendering of every retrieved notes.

vitorpamplona commented 1 year ago

So, I tested caching the full feed a few months ago:

  1. It takes some time to catch the feed (a few seconds).
  2. It consumes a lot of memory. We go from loading about 1000 events for each of the 9 feeds we have to 60,000 events per feed. Since most of them will not be seen by the user, it doesn't seem like a good strategy.

But maybe there is some middle-of-the-road somewhere.

Yonle commented 1 year ago

Full feed was a hell for mobile phone memory (RAM) :)

I guess by loading notes till 20-50 notes first should probably better than loading the entire feed with thousand of notes, Noting that users not really reading even 100 notes in a single timeline feed.