Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Avoid recalculating entire permission set after every portal removal in a batch. #313
When reloading Multiverse-Portals (as is triggered by Multiverse-Adventure), the server hangs for a bit while permissions are recalculated. The time is dependent on the number of Permissibles, Permissions, and Portals. In my case, the server would lock up for 1:30. Looking at the code, I managed to get it down to roughly half that.
In MVPortal.java, I removed lines 170-173. recalculatePermissionDefaults calculates recursively, so the were already recalculated on line 169.
In PortalManager, rather than recalculating the permission set after removing each portal in a batch, I remove them all, delaying the recalculation until they are all removed.
If I missed anything, or need to correct anything, please let me know.
Well look at that... Wouldn't you know that the load time issue is related to a permission problem. Thanks for figuring that out! I'm gonna have to look this over more thoroughly before I can make a decision on pulling it. I'd much rather have a better fix for this but the fix I had in mind would likely require a near total rewrite of the plugin which of course will come along with MV-3.