The RolesInRoles provider executes a separate SQL query to resolve subroles of each user's role. This can lead to slow response time in various parts of the Sitecore interface when a complex roles structure is used.
The following patch adds a new RolesInRoles provider that uses a single query to get the results: