Skip to content

Improve all results page performance by a new cache table for best ex… - #1539

Draft
sayravai wants to merge 1 commit into
apluslms:masterfrom
sayravai:allresults2025-rebased-squashed
Draft

Improve all results page performance by a new cache table for best ex…#1539
sayravai wants to merge 1 commit into
apluslms:masterfrom
sayravai:allresults2025-rebased-squashed

Conversation

@sayravai

@sayravai sayravai commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

…ercise points per student.

Description

What?

Currently the All results page may not load at all for large courses, as there will be a server timeout while waiting for the results. The slowness is due to the database operations required to gather the best submissions per each student, so this PR introduces a caching table for the points of best submissions for each student/exercise. These values can be read directly from this cache table, so the All results page loads magnitudes faster. The downside is, that the cache table needs to be written on every submission, which may get slow due to the required index updates. I'm submitting this PR as draft so the performance can be further tested before deciding whether this approach is suitable for our use case.

There is a helper script (exercise/management/commands/backfill_exercise_user_points.py) for populating a cache table from an existing database. This needs to be run before testing.

Fixes #

Testing

Remember to add or update unit tests for new features and changes.

What type of test did you run?

  • Accessibility test using the WAVE extension.
  • Django unit tests.
  • Playwright tests.
  • Other test. (Add a description below)
  • Manual testing.

[ADD A DESCRIPTION ABOUT WHAT YOU TESTED MANUALLY]

Did you test the changes in

  • Chrome
  • Firefox
  • This pull request cannot be tested in the browser.

Think of what is affected by these changes and could become broken

Translation

Programming style

  • Did you follow our style guides?
  • Did you use Python type hinting in all functions that you added or edited? (type hints for function parameters and return values)

Have you updated the README or other relevant documentation?

  • documents inside the doc directory.
  • README.md.
  • Aplus Manual.
  • Other documentation (mention below which documentation).

Is it Done?

  • Reviewer has finished the code review
  • After the review, the developer has made changes accordingly
  • Customer/Teacher has accepted the implementation of the feature

Clean up your git commit history before submitting the pull request!

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