jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig (JIRA) <j...@apache.org>
Subject [jira] [Commented] (OAK-370) Creating Root is too expensive
Date Wed, 10 Oct 2012 09:31:02 GMT

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

Michael Dürig commented on OAK-370:

This has been fixed with OAK-272. The test below creates 10000000 {{Root}} instances within
1.9 seconds. Only when I uncomment {{root.commit}} it goes up to 18s. So I think it's something
different which is expensive in your case.

public void getRootInALoop() throws CommitFailedException {
    long t0 = System.currentTimeMillis();
    for (int k = 0; k < 1000000; k++) {
        RootImpl root = createRootImpl(null);
        root.createRootBuilder().setProperty("foo" + k, "bar");
//      root.commit();
    System.out.println(System.currentTimeMillis() - t0);
> Creating Root is too expensive
> ------------------------------
>                 Key: OAK-370
>                 URL: https://issues.apache.org/jira/browse/OAK-370
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core
>            Reporter: angela
> see http://mail-archives.apache.org/mod_mbox/jackrabbit-oak-dev/201210.mbox/%3C50741032.4050706@adobe.com%3E
> imo creating a new root instance (and thus creating a new session) should
> be for free. even creating a root instance that is just used for reading should be cheap.
all kind of extra effort associated with a potential write operation should be postponed until
write does really happen.

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

View raw message