]> git.ipfire.org Git - thirdparty/samba.git/commit
ldb_kv_index: dn_list load sub transaction can re-use keys
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 25 Jun 2024 23:05:49 +0000 (11:05 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Sat, 27 Jul 2024 22:47:39 +0000 (22:47 +0000)
commit5f0198d69843c864f2b98a7c0c6305ad789a68a0
treee5f2df0469e44f50665587b17dd3a7db5e799408
parented7bc50b00ea62a12d17e56a686053e0a956d8f8
ldb_kv_index: dn_list load sub transaction can re-use keys

We don't want to modify the original list, but we can reuse the keys
if we treat them as immutable and don't free them. That makes it a lot
quicker if there are many keys (i.e. where an index is useful) and may
sub-transactions. In particular, it avoids O(n²) talloc_memdups.

A removed comment that says "We have to free the top level index
memory otherwise we would leak", and this will be addressed in the
next commit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15590

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/ldb/ldb_key_value/ldb_kv_index.c