directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel L├ęcharny <elecha...@gmail.com>
Subject API changes impact on ApacheDS, take 5
Date Mon, 23 May 2016 09:38:19 GMT
Ok, I have changed the way I deal with DN.

The simple fact is that, at some point, having the Normalized form of a
RDN or DN is very convenient. Comparing two strings is around 500 times
faster than comparing two DNs...

The extra cost of constructing a Normalized String for a DN is around
20%, but a single call to DN.equals( Dn) call is itself representing 20%
of a DN parsing. And we do more than one DN.equals() during any Ldap
operation !

I have reworked the API this week-end to compute the Normalized form
again, in an efficient way, and evern with the extra cost, it's still
way, ways faster than the previous Dn parsing.

Some numbers, obtained with JMH :

- parsing a 4 RDNs long DN, with normalized form : 3.087 us (microSeconds)
- parsing the same DN, no normalized form computed : 2.720 us
- current trunk DN parsing of a 4 RDNs long DN : 6.936 us
- DN.equals(DN) : 0,48us (15% of the DN parsing's time)
- Dn.getNormName().equals( Dn.getNormName() ) : 0,9 ns !!! (ie, 0,03% of
the DN's Parsing time)

Mime
View raw message