Currently Ranger Usersync updates users and groups to Ranger Admin one at a time. This causes lot of traffic between userync and ranger admin during initial sync. Instead update users, groups, and memberships in batches after computing the deltas. Batch update also applies for subsequent sync cycle.
Also, in case of AD/LDAP sync source with incremental sync, usersync doesn't maintain in-memory cache to compute deltas. During every restart of usersync, usersync performance full sync with AD/LDAP and updates all the users and groups to ranger admin (even though there are no updates to users and groups at the source). This can be avoided by caching the users and groups that are existing in ranger db during startup and compute deltas at usersync like other sync source code paths.
Currently building initial cache in usersync is taking considerable amount of time especially when the no. of users and groups are large. This needs to be improved as well.