tbranyen / hyperlist

A performant virtual scrolling list utility capable of rendering millions of rows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve the viewport algorithm

tbranyen opened this issue · comments

There is an insane amount of waste between renders during scroll events. Maybe use Sets to track elements and only request new rows to account for the difference. This would greatly improve the scrolling on mobile. It would also eat up less memory and have less redraw cost.

@soyuka any thoughts on what I was thinking here wrt to finding the difference between new and old sets to update changed elements?

I'm not sure to understand and I think that performance have been improved with my refactoring (from position is more precise, less rendered items).

If you're talking about caching _getRow calls, I think it's not necessary.

Okay cool, I definitely noticed an improvement with perf from your code changes. We have an app here at Netflix that uses HyperList and we cache a Set that gets used by _getRow calls, so if you need this its definitely possible to do outside of HyperList.