Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-5186

ChangeSetFilterImpl: support many includePaths by filtering for 1st path name

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.5.14
    • Fix Version/s: 1.5.16, 1.6.0
    • Component/s: core
    • Labels:
      None

      Description

      When there is a large number of include paths in the ChangeSetFilterImpl and combine that with a large-ish ChangeSet (many paths) then the comparison becomes expensive, as there is a loop with each ChangeSet-path, then looping through each include path. Basically an O(n*m).

      A probably ideal solution would be to implement a tree with the tree items be the path elements. And have two sets of trees: the filter one and the ChangeSet one.

      A simpler and perhaps 'good enough' solution could be to just look at the first level name of both the filter include paths: if a ChangeSet path's first level name is not in that set, then it can't be included. That would allow to skip the pattern comparison (which is slower even though it is a compiled Pattern).

        Attachments

        1. OAK-5186.patch
          4 kB
          Stefan Egli

          Activity

            People

            • Assignee:
              mreutegg Marcel Reutegger
              Reporter:
              stefanegli Stefan Egli
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: