[ 
https://issues.apache.org/jira/browse/OAK-201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420579#comment-13420579
 ] 

Jukka Zitting commented on OAK-201:
-----------------------------------

Here's a quick draft of what I think the name mapper for the "no session-local 
namespace remappings" case should look like:

{code}
private static final Map<String, String> STANDARD_NAMES =
        ImmutableMap.<String, String>builder()
        .put(NodeType.NT_BASE, "nt:base")
        .put(Property.JCR_PRIMARY_TYPE, "jcr:primaryType")
        ...
        .build();

public String getOakName(String jcrName) {
    if (jcrName.charAt(0) != '{') {
        return jcrName;
    }

    String oakName = STANDARD_NAMES.get(jcrName);
    if (oakName != null) {
        return oakName;
    }
     // Fall back to normal parsing and mapping of the name
}
{code}
                
> NamespaceRegistry is very slow
> ------------------------------
>
>                 Key: OAK-201
>                 URL: https://issues.apache.org/jira/browse/OAK-201
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>            Reporter: Thomas Mueller
>
> The NamespaceRegistryImpl.getURI and getPrefix are called a lot, for example 
> by NamePathMapperImpl.getOakName. 
> The method doesn't do any caching, which is a problem because it has to read 
> it each time from the repository. Even if it would do caching, it wouldn't 
> help because it the method WorkspaceImpl.getNamespaceRegistry creates a new 
> NamespaceRegistryImpl each time it is called. To allow caching of known 
> mappings, the instance needs to be cached as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to