Add profiling to getEffectiveGroups()