Bukkit/Bukkit — pull request #466 by Evenprime (2011-12-29 14:23:44+00:00)
Title: Allow bulk set/unset of attachment permissions and avoid many useless

recalculations of permissions for higher performance.

I'm currently working on a permissions related plugin (set/unset PermissionAttachment based on player locations) and need to be able to efficiently add/remove permissions in form of PermissionAttachments. The current implementation of these is very inefficient because it recalculates all permissions of a Permissible whenever a single permission of the attachment changes (sometimes even if nothing changes at all). Especially when there are thousands of permissions registered on the server, it may take up to several seconds if a lot of single permissions have to be added to an permission attachment.

This commit will highly improve performance and allow to add/remove multiple permissions at once. I'll comment the single code changes in the "commit" tab in detail. It will NOT break any existing functionality of Permissions or PermissionAttachments.

I'd highly appreciate to get feedback on this asap, because this is the only remaining block on the road for me.