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

Speedup render of eventProblems table #98

Merged
merged 4 commits into from
Nov 1, 2023
Merged

Speedup render of eventProblems table #98

merged 4 commits into from
Nov 1, 2023

Conversation

alasdairwilson
Copy link
Collaborator

@alasdairwilson alasdairwilson commented Oct 31, 2023

closes #92 . The current page was in such a bad way, I couldn't even get the profiler to work without crashing, this makes some small changes and it has dramatic effects:

  1. Filter students by event first to reduce the number of users later maps will be iterated over.
  2. presort problems by user into an obj keyed to the user, this changes the order of the render from O(n^2) to O(2n)
  3. Remove the rows for eventgroups with no eventitems (e.g. lectures)
  4. Reduce padding on table, both avatars and problem status, this speeds up the render (possibly by removing the scrolling) and makes the table look better.

Together these reduce the time to load that page from ~45-90s (and then unresponsive at that) to ~2-4s but then the problem is tooltips, I discovered all tooltips were being rendered despite being not visible, I suspected there would be a way to lazyload the tooltips, or to mount them only when they are being used and found this:

mui/material-ui#10909 and mui/material-ui#12085

Seems the material UI people found the same issue with tooltips being effectively unusable at scale, sadly flowbite does not have the same "lazy loading" ability.

So I swapped the tooltips from flowbite to material UI on this page only, this makes the render almost instant:

fast_table_2

Copy link
Contributor

@martinjrobins martinjrobins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, thanks @alasdairwilson

@martinjrobins martinjrobins merged commit 676cefb into main Nov 1, 2023
2 checks passed
@alasdairwilson alasdairwilson deleted the test_profile branch November 1, 2023 11:52
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

Successfully merging this pull request may close these issues.

event view for instructors gets very slow for increasing number of students
2 participants