Skip to content

Speed up the achievement users page. #2715

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

Open
wants to merge 1 commit into
base: WeBWorK-2.20
Choose a base branch
from

Conversation

drgrice1
Copy link
Member

The usual thing (by now with this series of pull request) is done. That is removing database access from loops and reducing to single queries as much as possible.

In addition instead of using the Mojolicious tag helpers to render the "earned" checkbox and "counter" text field, direct html is used. I discovered that this renders much faster. With the usual 5000 user test the rendering of the template alone takes 5 seconds after changing a checkbox or counter value and saving, while with the direct html it takes something like 0.2 seconds. I believe that it has something to do with their code to set the values of the inputs that is causing the slow down. I am not sure on that, but I know that the direct html is much faster.

That database changes are still the biggest part of the speed improvement here in any case. This page was rendering quite slowly even on initial load before, and that part was fast with the tag helpers. After making the database changes things sped up considerably, but then timing parts of the code when saving revealed the tag helper issue.

@drgrice1
Copy link
Member Author

I forgot to mention that the "counter" text input was also switched to a number input with a minimum value of 0 and the default step size of 1.

@drgrice1 drgrice1 force-pushed the achievement-user-editor-improvements branch 2 times, most recently from 612d485 to 0b0ded3 Compare April 27, 2025 16:14
@drgrice1 drgrice1 changed the base branch from develop to WeBWorK-2.20 April 29, 2025 12:21
The usual thing (by now with this series of pull request) is done.  That
is removing database access from loops and reducing to single queries as
much as possible.

In addition instead of using the Mojolicious tag helpers to render the
"earned" checkbox and "counter" text field, direct html is used. I
discovered that this renders much faster.  With the usual 5000 user test
the rendering of the template alone takes 5 seconds after changing a
checkbox or counter value and saving, while with the direct html it
takes something like 0.2 seconds.  I believe that it has something to do
with their code to set the values of the inputs that is causing the slow
down.  I am not sure on that, but I know that the direct html is much
faster.

That database changes are still the biggest part of the speed
improvement here in any case.  This page was rendering quite slowly even
on initial load before, and that part was fast with the tag helpers.
After making the database changes things sped up considerably, but then
timing parts of the code when saving revealed the tag helper issue.
@drgrice1 drgrice1 force-pushed the achievement-user-editor-improvements branch from 0b0ded3 to c4fa2d0 Compare April 29, 2025 20:05
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.

1 participant