[
https://issues.apache.org/jira/browse/SLING-4591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tomek Rękawek resolved SLING-4591.
----------------------------------
Resolution: Fixed
Fix Version/s: API 2.10.0
Nice catch, thanks! Fixed in r1693875, as suggested - by using
{{Collections.emptyMap()}}.
> Performance: Consider using a faster empty map in
> ResourceMetadata#setParameterMap
> ----------------------------------------------------------------------------------
>
> Key: SLING-4591
> URL: https://issues.apache.org/jira/browse/SLING-4591
> Project: Sling
> Issue Type: Improvement
> Components: API
> Affects Versions: API 2.9.0
> Reporter: Joel Richard
> Assignee: Tomek Rękawek
> Priority: Minor
> Labels: perfomance
> Fix For: API 2.10.0
>
>
> 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().
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)