Fixed Performance of rebuilding permissions

Xon

Well-known member
Affected version
2.0.2
Once thing I've noticed with XF2 is that the performance of rebuilding permissions is much worse than XF1.

If there are too many permission combinations PermissionRebuild job is queued. This rebuilds every permission combination, not just the changed combinations. For large number of combinations which aren't being changed, this has a significant overhead. Why couldn't this job take a combination id, and the calling code generate a job per combination id? This would ensure only one rebuild per combination id was possible and is very simple to implement.

Finally, saving a user group always triggers a triggerCacheRebuild. Despite the entity representing permission entity may not be changing, and there being non-permission settings on a usergroup.

Together these two issues make touching permissions vastly slower than they need to be.
 
Not off hand (for XF1 to XF2), but the difference between rebuilding all permissions combinations to just the selected combinations has a difference in 1-3 minutes for me.
 
Top Bottom