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 "Jukka Zitting (JIRA)" <ji...@apache.org> on 2013/02/25 16:08:15 UTC

[jira] [Commented] (OAK-652) ItemImpl.checkProtected() is too slow

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

Jukka Zitting commented on OAK-652:
-----------------------------------

In revision 1449729 I added a simple feature flag to disable the current transient item definition checks.

Here's how the SegmentMK performs with the new simple WikipediaImport benchmark:

{noformat}
$ java -jar oak-run/target/oak-run-0.7-SNAPSHOT.jar benchmark \
      --wikipedia=fowiki-20130213-pages-articles.xml WikipediaImport Oak-Segment
Apache Jackrabbit Oak 0.7-SNAPSHOT
Wikipedia import (fowiki-20130213-pages-articles.xml)
Oak-Segment: importing Wikipedia...
[...]
Imported 12148 pages in 74 seconds (6094us/page)
{noformat}

Disabling the item definition checks improves import speed by almost 50%:

{noformat}
$ java -DOAK-652=true -jar oak-run/target/oak-run-0.7-SNAPSHOT.jar benchmark \
      --wikipedia=fowiki-20130213-pages-articles.xml WikipediaImport Oak-Segment
Apache Jackrabbit Oak 0.7-SNAPSHOT
Wikipedia import (fowiki-20130213-pages-articles.xml)
Oak-Segment: importing Wikipedia...
[...]
Imported 12148 pages in 40 seconds (3307us/page)
{noformat}

                
> ItemImpl.checkProtected() is too slow
> -------------------------------------
>
>                 Key: OAK-652
>                 URL: https://issues.apache.org/jira/browse/OAK-652
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: jcr
>            Reporter: Jukka Zitting
>              Labels: performance
>
> As mentioned in http://markmail.org/message/6jktvy53wqyhxlht, with the current node type code the {{ItemImpl.checkProtected()}} call is pretty expensive. I profiled simple {{addNode}} and {{setProperty}} calls and got the following results (showing relative time spent in each method):
> {code}
> org.apache.jackrabbit.oak.jcr.NodeImpl.addNode
>   61% org.apache.jackrabbit.oak.jcr.SessionDelegate.perform
>   39% org.apache.jackrabbit.oak.jcr.ItemImpl.checkProtected
> org.apache.jackrabbit.oak.jcr.NodeImpl.setProperty
>  100% org.apache.jackrabbit.oak.jcr.NodeImpl.internalSetProperty
>    55% org.apache.jackrabbit.oak.jcr.ItemImpl.checkProtected
>    45% org.apache.jackrabbit.oak.jcr.SessionDelegate.perform
> {code}
> By keeping explicit track of effective node types and item definitions we could probably drive down the cost at least one order of magnitude, but as mentioned on oak-dev@ I'd rather avoid the call entirely since the relevant constraints are in any case checked during save().
> This issue exists to track either the removal or optimization of the checkProtected(), depending on what consensus we reach.

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