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

GlobbingPathFilter constructor is expensive

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.0
    • 1.7.0, 1.6.1, 1.8.0
    • core
    • None

    Description

      The GlobbingPathFilter constructor is doing an expensive ImmutableList.copyOf while traversing down a path as part of filtering. ImmutableList internally first creates a Builder with capacity 4 - thus frequently has to do an ObjectArrays.arraysCopyOf.

      Two things that can be improved here:

      • as suggested by mduerig that private constructor - should not copy at all. Only the public constructors should. So the public constructors should be rewritten to reflect this.
      • ImmutableList.copyOf cannot be passed an initial capacity unfortunately. Perhaps there's an alternative for this though.

      Attachments

        1. OAK-5589.patch
          5 kB
          Stefan Egli

        Activity

          People

            stefanegli Stefan Egli
            stefanegli Stefan Egli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: