replmd: Group together link attribute processing by source object
commit628b9f71c7d5cf2b76cd9f6a87bc30ac8fa14167
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 23 Oct 2018 23:30:17 +0000 (24 12:30 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 1 Nov 2018 19:38:14 +0000 (1 20:38 +0100)
tree84942e5f4711a2e4588b5254549a3264fc173eed
parent5528a4cce4f7520bec3305f5ba2951378184687d
replmd: Group together link attribute processing by source object

Instead of processing each link attribute one at a time, we want to
group them together by source object. This will mean we only have to
look-up the source object once, and only perform one DB 'modify'
operation. With groups with 1000s of members, this will help improve
performance.

This patch takes the first step of group together the links by
source-object. A new 'la_group' struct is added to help track what links
belong to the same source object. The la_list essentially becomes a
'list of lists' now.

Note that only related links *in the same chunk* are only grouped together.
While it is trivial to groups together links that span different
replication chunks, this would be a fairly insignificant efficiency gain,
but seems to have a fairly detrimental memory overhead, once you get
into groups with 10,000+ members.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/repl_meta_data.c