-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fetch all filter values with AJAX in list views #2735
Comments
I imagine this will come when there is front-end rewrite done, like v3 or something. |
I already started to work on this, if someone is interested. |
If this were to be done, it would be rolled into the select2 UI changes which are under active development in the select2-ui branch. |
This has been wrapped into #2753 and is currently implemented for the DCIM app in the |
Implemented in |
Great, thanks a lot! Sorry, I finally didn't have time to deal with that. |
Environment
Proposed Functionality
In views like
/dcim/devices/
or/dcim/racks/
, that include a search bar with filters, values inside each filters could be fetched asynchronously with AJAX, instead of waiting for the server to fill them before rendering the page.Use Case
If in one of these filters, there is a lot of objects (multiple thousands), currently the page takes time to render, as it is single threaded and heavy on CPU (in the python code, not necessarily in database if you disable the natural ordering sort).
The most important when listing some objects in a view is the table of objects, there is no really need to wait for the filters to be rendered. These filters could be fetched in AJAX, and marked as disabled as long as the query is not over.
The page would be a lot quicker to render. For me, with 150K devices and 4K racks, by doing that for the devices view, django-debug-toolbar indicates a reduction from 3s CPU time to 800ms.
Also, it would allow to multithread each filter, and would work even better if the user has a cluster of Netbox servers.
Database Changes
None
External Dependencies
None
The text was updated successfully, but these errors were encountered: