Bukkit/Bukkit — pull request #462 by Evenprime (2011-12-25 14:22:16+00:00)
Title: Don't unnecessarily recalculate permissions

At this code location, the only change made to permissions is that we added an empty attachment. We know that it is empty because it gets created empty just 2 lines above.

Yet we still do recalculate all permissions afterwards (very expensive operation!) for no reason, as nothing could have changed. This is especially wasteful, because shortly afterwards another recalculation will take place anyway, when the plugin that added the attachment (or the calling method - this method is used by many others in this class) starts to fill it with permissions.

Just stumbled upon this and found that it's a very simple way to cut the time it takes to add a permission attachment to a player in half.