[Freeipa-devel] [PATCH] 811 performance: faster DN implementation

Petr Vobornik pvoborni at redhat.com
Tue Mar 31 10:11:39 UTC 2015


The only different thing is a lack of utf-8 encoded str support(as 
input). I don't know how much important the support is.

maybe it could be attached to ticket 
https://fedorahosted.org/freeipa/ticket/4947
-----
DN code was optimized to be faster if DNs are created from string. This 
is the major use case, since most DNs come from LDAP.

With this patch, DN creation is almost 8-10x faster (with 30K-100K DNs).

Second mojor use case - deepcopy in LDAPEntry is about 20x faster - done 
by custom __deepcopy__ function.

The major change is that DN is no longer internally composed  of RDNs 
and AVAs but it rather keeps the data in open ldap format - the same as 
output of str2dn function. Therefore, for immutable DNs, no other 
transformations are required on instantiation.

The format is:

DN: [RDN, RDN,...]
RDN: [AVA, AVA,...]
AVA: ['utf-8 encoded str - attr', 'utf-8 encode str -value', FLAG]
FLAG: int

Further indexing of DN object constructs an RDN which is just an 
encapsulation of the RDN part of open ldap representation. Indexing of 
RDN constructs AVA in the same fashion.

Obtained EditableAVA, EditableRDN from EditableDN shares the respected 
lists of the open ldap repr. so that the change of value or attr is 
reflected in parent object.
-- 
Petr Vobornik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0811-performance-faster-DN-implementation.patch
Type: text/x-patch
Size: 39766 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20150331/faf8dde5/attachment.bin>


More information about the Freeipa-devel mailing list