https://bugs.openldap.org/show_bug.cgi?id=10458
Issue ID: 10458 Summary: improve handling of large entry modifications Product: OpenLDAP Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: slapd Assignee: bugs@openldap.org Reporter: ondra@mistotebe.net Target Milestone: ---
If modifying a huge entry (e.g. a super-large group with countless members), we (back-mdb) spends about 50% of time on memmove() in attr_dup2 just copying the data around. We don't need this, this e_attrs doesn't outlive the mdb_modify that transitively calls it nor do we write into the data themselves.
We should be able to tell attrs_dup that it can reuse parts of the original attributes and set `SLAP_ATTR_DONT_FREE_DATA` on the resulting attributes if the caller claims it will take care of the lifetimes accordingly, including any new values it puts in.