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

Felix Meschberger commented on JCR-3870:
----------------------------------------

I don't think it is worth exporting such a method.

The most basic problem is the JCR API requesting the getItem method to throw in 
case the item does not exist. So the itemExists method has been added to be 
able to check the existence (or visibility, actually) of the item before trying 
to access it.

So, the actual performance problem boils down to being an implementation 
problem: The API specification as [~mreutegg] pointed out suggest to check for 
existence before accessing the item and this is what Sling does. In other word 
Sling follows the API specification guidance.

As such Sling is expecting the implementation to do the best to support the API 
and the API guidance.

> Export SessionImpl#getItemOrNull in JackrabbitSession
> -----------------------------------------------------
>
>                 Key: JCR-3870
>                 URL: https://issues.apache.org/jira/browse/JCR-3870
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-api
>    Affects Versions: 2.10
>            Reporter: Joel Richard
>            Priority: Critical
>              Labels: performance
>
> getItemOrNull should be exported in JackrabbitSession. This would allow to 
> combine itemExists and getItem in Sling which would reduce the rendering time 
> by 8%.
> See the following mail thread for more information: 
> http://mail-archives.apache.org/mod_mbox/jackrabbit-oak-dev/201504.mbox/%3CD1495A09.3B670%25anchela%40adobe.com%3E



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to