Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-1478

[Perf] The filterContents() method is suboptimal

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.5.5
    • 2.0.0-RC2
    • core
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            elecharny Emmanuel Lécharny
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: