Skip to content

Lower memory usage in submissions and projects#4795

Open
frjo wants to merge 13 commits intomainfrom
enhancement/lower-ram-usage-submissions
Open

Lower memory usage in submissions and projects#4795
frjo wants to merge 13 commits intomainfrom
enhancement/lower-ram-usage-submissions

Conversation

@frjo
Copy link
Copy Markdown
Member

@frjo frjo commented Apr 1, 2026

Fixes #4520

This are not dramatic changes but many small things adds up. In testing the savings are small but I think that on large live environments they can be noticeable.

  • Defer loading to have fields like search_data, search_document, form_data and form_fields only load when needed.
  • Use submission_id instead of submission.id to avoid a db query when the model is not loaded/needed.
  • Implement select_related() to avoid N+1 queries.
  • Cache get_object() so it is not loaded multiple times in one request.

@frjo frjo added Type: Enhancement This is an improvement of an existing thing (not a new thing, which would be a feature). Type: Patch Mini change, used in release drafter Status: Needs testing Tickets that need testing/qa Status: Needs dev testing 🧑‍💻 Tasks that should be tested by the dev team labels Apr 1, 2026
@frjo
Copy link
Copy Markdown
Member Author

frjo commented Apr 1, 2026

@wes-otf I have put this on test now so we can make sure it doesn't break anything.

@frjo frjo temporarily deployed to test-hypha-app April 1, 2026 13:08 Inactive
@frjo frjo force-pushed the enhancement/lower-ram-usage-submissions branch from 7a5b60c to fb0e165 Compare April 1, 2026 15:47
@frjo frjo temporarily deployed to test-hypha-app April 1, 2026 15:52 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Needs dev testing 🧑‍💻 Tasks that should be tested by the dev team Status: Needs testing Tickets that need testing/qa Type: Enhancement This is an improvement of an existing thing (not a new thing, which would be a feature). Type: Patch Mini change, used in release drafter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minimise memory usage of Hypha

1 participant