Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite scroll in pages #561

Open
sliterok opened this issue Mar 15, 2024 · 2 comments
Open

Infinite scroll in pages #561

sliterok opened this issue Mar 15, 2024 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@sliterok
Copy link

Is your feature request related to a problem? Please describe.
When I implement infinite scroll example on a big dataset the page starts to slow down and use a lot of memory, eventually completely freezing.

Describe the solution you'd like
It should behave like pagination, where only a couple of pages are loaded into memory and those pages represent current window that user can or could see.
readPage is callback with params like from, to or pageNumber, should return list of records.
When initialized has no records but has totalRecords, calls readPage() to get records for the first page.
When user is close to the bottom of the window it should call the readPage() to get new page.

Describe alternatives you've considered
make records not actual records but ids of those records, i.e. string[].
getRecordsByIds callback which accepts ids: string[] parameter and returns the records in batches.
otherwise logic is similar to the variant above

Additional context
I'm using OPFS to store and get a lot of records from virtual file storage in browser and I want to see how far it could go in terms of how smooth the experience is.

@isnifer
Copy link

isnifer commented Apr 4, 2024

Actually, I'm getting a lot of memory consumption even on 118 records with 10 columns.

UPD: I checked memory and CPU consumption starting from 7.1.5 to nowadays for my case:
7.1.5 — MEM: ~300MB, CPU: ~32%
7.3.0 — MEM: ~500MB, CPU: ~125%
7.4.0 — MEM: ~500MB, CPU: ~125%
7.6.1 — MEM: ~500MB, CPU: ~125%

What I was doing — just scrolled up and down in 30 seconds.

So, something happened in 7.3.0

@icflorescu icflorescu added enhancement New feature or request help wanted Extra attention is needed labels Apr 4, 2024
@icflorescu
Copy link
Owner

@sliterok unfortunately I don't have the time to consider this, but I'm open to discuss a PR if you fee like it.

@isnifer - if I remember correctly, the column toggling / resizing feature was added in 7.3 (see #483), so a certain performance cost is expected, but I haven't seen anything like the figures you posted above in my apps.
In fact, in production, on Brave, what I'm typically seeing in terms of memory consumption is 100MB — 150MB...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants