Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially fixes #380
On my laptop this brought the loading time for the admin page from a little over 2 minutes to about 25 seconds. The improvement came from fixing how we get data for the "User" tab. That part is actually nearly instantaneous now. The remaining 25 seconds come from a bunch of 1-2 second queries we have to fill in tables on the admin page.
The issue was that for the "User" tab we were getting the list of users, then for each user we were running a separate query (well, 7 queries) to get metadata about that user. Since there are something like 850 users, that was 850 * 5 = 5,950 separate queries. Now we are just running 7 queries and gathering all the results together!
Testing:
develop
branch and time how long it takes to load the admin page initially (this doesn't include any of the other tabs, just the initial page load). Then checkout the380-improve-admin-page-speed-1
branch and do the same. You should see a significant decrease in page load time.develop
and this new branch. Check the "User" tab and look for a few of the same users in each branch. Check that you get the same values in each column for each of those test users.