You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Michael Dürig (JIRA)" <ji...@apache.org> on 2013/09/23 13:44:03 UTC

[jira] [Updated] (OAK-701) Optimize Session.getNamespacePrefixes()

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

Michael Dürig updated OAK-701:
------------------------------

    Labels: perfomance  (was: )
    
> Optimize Session.getNamespacePrefixes()
> ---------------------------------------
>
>                 Key: OAK-701
>                 URL: https://issues.apache.org/jira/browse/OAK-701
>             Project: Jackrabbit Oak
>          Issue Type: Sub-task
>          Components: jcr
>    Affects Versions: 0.6
>            Reporter: Marcel Reutegger
>            Assignee: Marcel Reutegger
>            Priority: Minor
>              Labels: perfomance
>             Fix For: 0.7
>
>
> Apache Sling uses Session.getNamespacePrefixes() quite often. E.g. when reading content through a JcrPropertyMap:
> {code}
>    java.lang.Thread.State: RUNNABLE
>         at java.util.HashMap.put(HashMap.java:372)
>         at org.apache.jackrabbit.oak.plugins.name.Namespaces.getNamespaceMap(Namespaces.java:64)
>         at org.apache.jackrabbit.oak.plugins.name.ReadOnlyNamespaceRegistry.getPrefix(ReadOnlyNamespaceRegistry.java:116)
>         at org.apache.jackrabbit.oak.jcr.SessionImpl.getNamespacePrefix(SessionImpl.java:529)
>         - locked <0x00000007daf6c590> (a java.util.HashMap)
>         at org.apache.jackrabbit.oak.jcr.SessionImpl.getNamespacePrefixes(SessionImpl.java:495)
>         at org.apache.sling.jcr.resource.JcrPropertyMap.escapeKeyName(JcrPropertyMap.java:381)
>         at org.apache.sling.jcr.resource.JcrPropertyMap.read(JcrPropertyMap.java:344)
>         at org.apache.sling.jcr.resource.JcrPropertyMap.get(JcrPropertyMap.java:126)
>         at org.apache.sling.jcr.resource.JcrPropertyMap.get(JcrPropertyMap.java:147)
> {code}
> I'd like to optimize the case when there are not session re-mapped namespaces. In this case the prefixes can be returned from the namespace registry as is. This avoids the loop and reduces calls on the Oak API. Initial testing shows a performance improvement by a factor of 3.

--
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