-
Notifications
You must be signed in to change notification settings - Fork 5
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
Reduce load time when loading the edit section for sites with large hierarchy #63
Comments
In addition to optimizing the checks for locking/gating (which I haven't looked into yet), integrating jquery-pjax in the pagetree admin view would definitely help here. With jquery-pjax, we could avoid having to render all 7 tabs at once, which shouldn't be necessary anyways. |
One performance issue is in displaying the hierarchy of pages (this loop in the template https://github.com/ccnmtl/django-pagetree/blob/master/pagetree/templates/pagetree/edit_page.html#L121) Removing the The performance issue is bad on local development (i.e. my page load is 10 seconds on the WORTH2 pagetree edit view) but less noticeable on production, fortunately. |
Have you enabled Django's cache in your settings? I don't see a 'CACHES' line anywhere in the worth2 settings. |
When debugging the `is_last_child` cache, I saw the value of cache.get() here is either 1, 0, or None if the cached value isn't present. Currently, only values of 1 are getting used, because if the value is 0, the `if v:` to check if the cache is present fails. I think we need to be more specific here and do: `if v is not None:` This change improved performance a little bit in my local testing, but it's still not great: Calling the cache for each node in the tree takes time, and it would be great to find a way to interact with the cache just once for the pagetree edit page. refs #63
When debugging the `is_last_child` cache, I saw the value of cache.get() here is either 1, 0, or None if the cached value isn't present. Currently, only values of 1 are getting used, because if the value is 0, the `if v:` to check if the cache is present fails. I think we need to be more specific here and do: `if v is not None:` This change improved performance a little bit in my local testing with memcached, but it's still not great: Calling the cache for each node in the tree takes time, and it would be great to find a way to interact with the cache just once for the pagetree edit page. refs #63
closing this ticket because the load time for the pagetree admin section is now fine on worth2, after setting up caching. |
When running worth2 locally, the "view section" view loads in 500ms, while the "edit section" view loads in 2800ms. django-debug-toolbar reports the SQL queries only took 100ms. @sdreher says this due to the checks for locking / gating. It would be good to find a way to reduce the load time here.
The text was updated successfully, but these errors were encountered: