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

As people are added, the site is becoming sluggish and slow to load #579

Open
transiient opened this issue Jan 30, 2020 · 10 comments
Open

Comments

@transiient
Copy link
Collaborator

Not sure what could be done about this but I've just noticed it. With the amount of people who are in the list now, the website loads up quite slowly.

Could lazy-loading be implemented somehow?

@wesbos
Copy link
Owner

wesbos commented Jan 30, 2020

How is it slow? Scrolling? Images loading? rendering?

@transiient
Copy link
Collaborator Author

Using Firefox, these are the network stats I got:

262 requests
3.86 MB / 1.99 MB transferred
Finish: 11.96 s
DOMContentLoaded: 4.97 s
load: 11.53 s

A lot of the request were avatar URLs - these could possibly be minimised by only loading when they're in the viewport.

Filtering is also extremely slow for me but that could be due to my system (dual core i3).

@wesbos
Copy link
Owner

wesbos commented Jan 30, 2020

Yeah almost all of that is image requests. I'll add lazy loading, looks like it will be added to firefox soon so its a good solution.

Filtering does have a few MS of lag for me too. Likely in the React render. Anyone want to take a look at this?

@wesbos
Copy link
Owner

wesbos commented Jan 30, 2020

ee7be1d

@wesbos
Copy link
Owner

wesbos commented Jan 30, 2020

You can tell the lag is in the render because when we filter for small numbers, it's fast.

I bet we can just hide people instead of re-rendering each time. Let me try that..

@wesbos
Copy link
Owner

wesbos commented Jan 31, 2020

I goofed around with it for a bit yesterday but I don't think hiding it is the issue..

If anyone is good ith the profiler on react dev tools, please take a look. It very clearly shows that the render for the large tags( 150+ people) takes ~300ms which is way too long

@iamandrewluca
Copy link
Collaborator

Notes:

@transiient
Copy link
Collaborator Author

transiient commented Feb 12, 2020

This, from your link, looks incredibly promising, and I don't see it being too difficult to implement. Seems like it'll just take a few lines. I'll play around.

@iamandrewluca
Copy link
Collaborator

Or maybe infinite pagination can be added.
https://www.gatsbyjs.org/docs/adding-pagination/

@jonaskuske
Copy link

I think the easiest (potential) fix would be to apply content-visibility and contain-intrinsic-size in CSS, so only the visible parts are rendered by the browser: https://web.dev/content-visibility/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants