You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
duanwilliam
changed the title
[perf] lazy load leaderboard entries
[perf] leaderboard loads and renders excessive amounts of data
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.The text was updated successfully, but these errors were encountered: