[Perf] The filterContents() method is suboptimal
------------------------------------------------
Key: DIRSERVER-1478
URL: https://issues.apache.org/jira/browse/DIRSERVER-1478
Project: Directory ApacheDS
Issue Type: Improvement
Affects Versions: 1.5.5
Reporter: Emmanuel Lecharny
Fix For: 2.0.0-RC1
The way we process the entries to keep only the requested attributes in the
filterContents() method is suboptimal. The code does something like :
for each attributeType in the entry
do
for each requested attribute do
blah...
We should use the fact that the requested attributes is a set to check if the
entry attributeType is present in this set instead of looping over all of them.
We can also decide to do the opposite if the number of requested attribute is
far below the entry attributes.
Not that it could save a lot of process time currently, but it represents 3.5%
of the overall CPU, a portion that will increase greatly as soon as we get rid
of the costly and useless clone and other superfluous operations we do, so I
want to keep a track of this inefficiency for a later improvement.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.