jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcel Reutegger (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-235) Cache jcr name to QName mappings
Date Mon, 10 Oct 2005 09:11:52 GMT
    [ http://issues.apache.org/jira/browse/JCR-235?page=comments#action_12331697 ] 

Marcel Reutegger commented on JCR-235:
--------------------------------------

Ok, here is a second version of the QName caching patch.

- moved name related classes and interface into package o.a.j.name
- getQName() and getJCRName() added to NamespaceResolver interface
- AbstractNamespaceResolver provides optional support for NamespaceListener
- CachingNamespaceResolver implemented as decoration on AbstractNamespaceResolver
- NamespaceRegistryImpl used caching per aggregation (not inheritance)

Currently also LocalNamespaceMappings caches QName resolution, but I think we should only
cache mappings on the global NamespaceRegistryImpl. So I'm tempted to remove the caching again
from LocalNamespaceMappings. Thoughts on that?

I kept the static methods in QName because I think that's the place they belong to. The class
implements the JCR specification of a QName and should therefore also provide a parse facility
that is according to the spec.

The patch only include changes on NodeImpl and PropertyImpl to use the new methods in NamespaceResolver,
even though there are now many more places in the code that can benefit from the added getQName()
and getJCRName() methods in NamespaceResolver. I suggest to change the rest of the code later,
after this patch is accepted and committed.

> Cache jcr name to QName mappings
> --------------------------------
>
>          Key: JCR-235
>          URL: http://issues.apache.org/jira/browse/JCR-235
>      Project: Jackrabbit
>         Type: Improvement
>   Components: core
>     Reporter: Marcel Reutegger
>     Assignee: Stefan Guggisberg
>     Priority: Minor
>      Fix For: 1.0
>  Attachments: QNameResolver.patch
>
> Currently jcr names are always parsed and resolved into QName instances. Introducing
a cache would increase performance and also save memory because well known and often used
jcr names would always return the same QName instance from cache.
> Testing with common read operations shows a performance improvement of about 25%.
> The test involved the following methods on Node interface:
> - getProperty()
> - getProperties()
> - getName()
> - getPath()
> - isLocked()
> - isNodeType()
> - getPrimaryNodeType()
> - hasNodes()
> - getNodes()
> Attached proposed implementation of a QNameResolver.
> Please comment.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message