-
Notifications
You must be signed in to change notification settings - Fork 8
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
Slow modeladmin views because of PagePermissionHelper.get_valid_parent_pages #19
Comments
So the problem with
I propose getting rid of the queryset and instead generating and returning an iterator. That way code currently using If someone can give me the OK for this change I will work on the implementation right away. |
Hi @haplo, Thank you for reporting, and for looking so deeply into the performance here. Anything you can do to help improve things would be greatly appreciated, thanks :) I thought it might be helpful to first provide a little more information about the two main causes for
|
Thank you for your response @ababic.
On an unrelated note, would you get someone to review wagtail/wagtail#5311 and wagtail/wagtail#5314? Those optimizations are ready to go and would be great to have them in the next release. |
@haplo. Just wanted to let you know: I raised the matter of getting your PRs reviewed in the last core team meeting, and someone will get to them soon. If you do manage to find a way to optimise this part of modeladmin, I'll glady review that for you personally. |
Issue Summary
I have been profiling the Wagtail admin views because my users experience some very slow load times (10-30 seconds). I implemented some big optimizations already (see wagtail/wagtail#5311 and wagtail/wagtail#5314), and when I profiled the index view I found out that a lot of the time goes into
PagePermissionHelper.get_valid_parent_pages
because it builds a massive query with hundreds or thousands ofOR
operators.See the profiling for
![profiler_get_valid_parent_pages](https://user-images.githubusercontent.com/71658/58181650-b6ca5800-7c9b-11e9-85e7-fd0146f57bf2.png)
WMAView.dispatch
:I propose a solution in the next message.
Steps to Reproduce
I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: no, I profiled over a local Wagtail 2.4 with a snapshot of production data.
Technical details
The text was updated successfully, but these errors were encountered: