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

Carsten Ziegeler commented on SLING-3848:
-----------------------------------------

Thanks for your patch to the jcr resource bundle, Rob. I've applied a slightly 
modified version in rev 1618724:
- the resource metadata is always required, so I moved it's creation into the 
constructor
- I think in 99% of the cases getResourceType() is called, therefore I moved 
this to the constructor as well

[~fmeschbe] node.getProperty("jcr:primaryType").getString() resulted in an NPE 
for the integration tests, so apparently getProperty() returned null - which 
might be a temporary bug of the jackrabbit version used for testing. I'll have 
to investigate

> JcrNodeResource takes too long and initializes too much too soon
> ----------------------------------------------------------------
>
>                 Key: SLING-3848
>                 URL: https://issues.apache.org/jira/browse/SLING-3848
>             Project: Sling
>          Issue Type: Improvement
>          Components: JCR
>            Reporter: Rob Ryan
>            Assignee: Carsten Ziegeler
>             Fix For: JCR Resource 2.3.8, API 2.7.2
>
>         Attachments: sling.api.diff, sling.jcr.resource.diff
>
>
> In a performance test expected to reflect reasonably real-world conditions 
> (50 concurrent users of a mixed load 'forum' type application) I found 
> org.apache.sling.jcr.resource.internal.helper.jcr.JcrNodeResource.JcrNodeResource(ResourceResolver,
>  Node, ClassLoader) taking  more than 20% of time used. The majority of this 
> time was spent in setting the resource metadata and to a lesser extent the 
> resource type.
> Because the metadata especially is not often accessed and even the resource 
> type is not always accessed, delaying these initializations led to a 
> noticeable performance improvement.
> The attached patch delays resourcetype lookup and metadata lookups until 
> needed.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to