]> source.dussan.org Git - nextcloud-server.git/commit
drastic speedup for nested ldap groups
authormacjohnny <estebanmarin@gmx.ch>
Thu, 12 Jun 2014 07:51:23 +0000 (09:51 +0200)
committermacjohnny <estebanmarin@gmx.ch>
Thu, 12 Jun 2014 07:51:23 +0000 (09:51 +0200)
commit0af8aa689f128cbb930bed591f4ef79224049e83
tree7b39a30d32859d17686a606b654fd131515a24c7
parentede2aa236e0834fd4fac2ea59e7ef9c0a397ff06
drastic speedup for nested ldap groups

Changes a function call in getUserGroups to only retrieve group ids instead of objects.
this change significantly improves performance when using owncloud with many groups, e.g. nested ldap hierarchy (1.2.840.113556.1.4.1941), since getUserGroups gets called in oc_share::getItems, which is needed for every page request.
in my particular case, it took more than 10s to load the calendar page and more than 6s to load the file page.
this was in an environment with 100 user groups (nested) per user. The performance was bad due to the following call stack:
self::getManager()->getUserGroups($user)
  - getGroupObject() (executed for every group!)
     - groupExists() (resulting in many ldap-requests)
since the groups are loaded from ldap, it is unnecessary to check whether the group exists or not.
lib/private/group.php