Optimize page permission checking #2756

Merged
merged 1 commit into from Mar 1, 2014

Projects

None yet

2 participants

Contributor
acatton commented Feb 27, 2014

Hi,

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.

Member
digi604 commented Feb 28, 2014

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.

Member
digi604 commented Feb 28, 2014

A forwards port to 3.0 would be awesome as well ;)

@acatton acatton 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
    True
50f6f7e
Contributor
acatton commented Feb 28, 2014

@digi604 I fixed the tests.

@digi604 digi604 merged commit f5bd776 into divio:master Mar 1, 2014

1 check passed

default The Travis CI build passed
Details
@acatton acatton deleted the fusionbox:fix-menu-performance branch Mar 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment