-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
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 of OR operators.
See the profiling for WMAView.dispatch:

I propose a solution in the next message.
Steps to Reproduce
- Create a group with add, edit, publish permissions over hundreds of pages of the same content type.
- Add an user to the group.
- Log in as the user and go to that content type index page.
- Page load time should be higher than ideal.
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
- Python version: 3.7
- Django version: 2.0.3
- Wagtail version: 2.4
- Browser version: Firefox 60.6.1esr (64-bit) on Fedora 29 (not relevant to this issue)
Metadata
Metadata
Assignees
Labels
No labels