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

perf: optimize loading of django admin program pages #4537

Merged
merged 4 commits into from
Jan 9, 2025

Conversation

zawan-ila
Copy link
Contributor

@zawan-ila zawan-ila commented Jan 8, 2025

PROD-4274

Description

Program admin pages are taking a long time to load and sometimes may even time out. Looking at the traces, most of the time is being spent in rendering the html widgets.

This PR makes the following changes:-

  1. Add in_year_value to autocomplete_fields so that all ProductValue objects are not rendered in the html
  2. While calculating optgroups on SortedModelSelect2Multiple widgets, do not include unselected options. This prevents the unselected options from being rendered in the html. django_autocomplete_light also appears to be doing the same thing
  3. Currently, the sorting of SortedModelSelect2Multiple widgets is broken. We fix it by deferring the loading of sortable_select.js

Before

Screenshot 2025-01-09 at 1 44 36 PM Screenshot 2025-01-09 at 1 45 11 PM

After

Screenshot 2025-01-09 at 1 43 30 PM Screenshot 2025-01-09 at 1 44 07 PM

@zawan-ila zawan-ila merged commit 8bf269c into openedx:master Jan 9, 2025
14 checks passed
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.

3 participants