I discovered a bottleneck on my website. Generating the menu can take up to 50 seconds! After this fix, I can go down to 5 seconds. It's still not acceptable, but this is a quick fix.
Thank you for the pull request. Please have a look here: https://travis-ci.org/divio/django-cms/jobs/19753539
some of the tests are failing. just increase the number of expected queries.
A forwards port to 3.0 would be awesome as well ;)
Optimize page permissions checking
* group__users doesn't exist and it wasn't select_related
* group__user_set is a one to many, we should use prefetch_related
* has_permission_membership was still running even if has_perm was
@digi604 I fixed the tests.