New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid recalculating entire permission set after every portal removal in a batch. #313

Merged
merged 1 commit into from Jul 13, 2015

Conversation

Projects
None yet
2 participants
@JoshuaRogers

JoshuaRogers commented Apr 14, 2014

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.

Many thanks,
Joshua Rogers

@dumptruckman

This comment has been minimized.

Member

dumptruckman commented Apr 14, 2014

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.

@dumptruckman

This comment has been minimized.

Member

dumptruckman commented Jul 13, 2015

Gonna go ahead and pull this as it seems like a worthwhile fix. Sorry for the delay!.

dumptruckman added a commit that referenced this pull request Jul 13, 2015

Merge pull request #313 from JoshuaRogers/PermissionsPerformance
Avoid recalculating entire permission set after every portal removal in a batch.

@dumptruckman dumptruckman merged commit 086f750 into Multiverse:master Jul 13, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment