Hi
I’m aware this may no technically be the right list to discuss this but this list is impacted by this and fairly active.
During load testing of our application we found a case we spend 10% of your CPU time in SimpleRole#equals (see attachment). This is because SimpleRoleGroup uses an ArrayList to maintain a unique set of roles. As a result it has to call ArrayList#contains a lot, which is itself O(n). In fact because that’s done when iterating over all the roles it becomes O(n^2). In our case our principals can have up to 200 roles. I don’t know if this is exceptionally many or a common case.