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

[perf] leaderboard loads and renders excessive amounts of data #565

Open
duanwilliam opened this issue May 7, 2022 · 0 comments
Open

[perf] leaderboard loads and renders excessive amounts of data #565

duanwilliam opened this issue May 7, 2022 · 0 comments

Comments

@duanwilliam
Copy link
Contributor

duanwilliam commented May 7, 2022

edit: oh i guess this is similar to #513?

Currently, visiting the leaderboard fetches all users in the given time range. For the 2021-2022 school year, this amounts to ~160kb of data, and for all time, ~500kb (which will only increase over time). The leaderboard page eager loads all these entries as well, resulting in a DOM tree of nearly 9000 nodes when viewing just the 2021-2022 leaderboard. This is further antagonized by the fact that each entry contains an image, which results in a large amount of data being transferred.

It could be beneficial to lazy load leaderboard entries, e.g. fetch and render the next 50/100/whatever entries when the user scrolls to a certain point before the end of the currently rendered leaderboard.
In the meantime, we can add loading="lazy" to the profile images to at least save a bit on that end.

@duanwilliam duanwilliam changed the title [perf] lazy load leaderboard entries [perf] leaderboard loads and renders excessive amounts of data May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant