You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Sergiy Shyrkov (JIRA)" <ji...@apache.org> on 2013/04/19 15:21:15 UTC

[jira] [Updated] (JCR-3571) Light optimizatin for CachingNameResolver.getJCRName(Name)

     [ https://issues.apache.org/jira/browse/JCR-3571?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergiy Shyrkov updated JCR-3571:
--------------------------------

    Attachment: CachingNameResolver.patch

I've attached the patch against current trunk (revision 1469818) 
                
> Light optimizatin for CachingNameResolver.getJCRName(Name)
> ----------------------------------------------------------
>
>                 Key: JCR-3571
>                 URL: https://issues.apache.org/jira/browse/JCR-3571
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-spi-commons
>    Affects Versions: 2.2.13, 2.4.3, 2.5.3, 2.6
>            Reporter: Sergiy Shyrkov
>            Priority: Minor
>         Attachments: CachingNameResolver.patch
>
>
> In case of a Name which has no namespace (name.getNamespaceURI().length() == 0) there is perhaps no need to cache the resolved jcrName as it will be getLocalName().
> If this is true, than I would like to suggest the following slight optimization in the org.apache.jackrabbit.spi.commons.conversion.CachingNameResolver.getJCRName(Name) method:
>     public String getJCRName(Name name) throws NamespaceException {
>         if (name.getNamespaceURI().length() == 0) {
>             return name.getLocalName();
>         }
>         String jcrName = (String) cache.get(name);
> ...
> This will return earlier and "save" the lookup in the cache and further cache.put() (the GenerationalCache.put(Object, Object) is synchronized so avoiding the call makes things potentially faster).
> Thank you in advance!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira