Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-11558

[Performance] Remove resource -> path -> resource conversion

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Servlets Resolver 2.9.8
    • Servlets Resolver 2.9.14
    • Servlets
    • None

    Description

      Currently the ResourceCollector uses the LocationIterator to build a list of possible locations where the script for a resource type can be located.
      The interface is based on Strings (representing a repository path), although both within the LocationIterator and in the ResourceCollector Resources are used.

      • The mapping of a path to a string requires a repository access, thus accessing the repo twice (checking in the LocationIterator if a resource exists at a certain path, plus conversion of that path again into a resource in the ResourceCollector) is redundant. Instead the LocationIterator should just return resources instead of the paths to resources.
      • The LocationIterator implements the Iterator interface, although it is only used in the ResourceCollector, which just iterates over all entries in a single loop. The LocationIterator could just return a collection of Resources (not implementing the Iterator interface), which makes the logic in this class much cleaner.

      Attachments

        Activity

          People

            joerghoh Joerg Hoh
            joerghoh Joerg Hoh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m