[ https://issues.apache.org/jira/browse/DIRSERVER-1478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Emmanuel Lecharny updated DIRSERVER-1478: ----------------------------------------- Description: The way we process the entries to keep only the requested attributes in the {{filterContents()}} method is suboptimal. The code does something like : {noformat} for each attributeType in the entry do for each requested attribute do blah... {noformat} 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. was: 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. > [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 > Priority: Major > Fix For: 2.0.0-RC2 > > > The way we process the entries to keep only the requested attributes in the > {{filterContents()}} method is suboptimal. The code does something like : > {noformat} > for each attributeType in the entry > do > for each requested attribute do > blah... > {noformat} > 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 was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org For additional commands, e-mail: dev-h...@directory.apache.org