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

Performance: Consider using a faster empty map in ResourceMetadata#setParameterMap

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • API 2.9.0
    • API 2.11.0
    • API

    Description

      ResourceMetadata#setParameterMap is called several thousand times per request. In my case the passed parameterMap is always empty. Since it has to create a new empty LinkedHashMap for each call, 1-2% of the rendering time is spent in this method.

      Therefore, I would suggest to either ignore empty maps or use Collections.emptyMap() instead. Both solutions should work if the caller does not make any undocumented assumptions for getParameterMap().

      Attachments

        Activity

          People

            tomek.rekawek Tomek Rękawek
            joelrich Joel Richard
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: