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 "Michael Dürig (JIRA)" <ji...@apache.org> on 2012/10/10 11:31:02 UTC
[jira] [Commented] (OAK-370) Creating Root is too expensive
[ 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.
{code}
@Test
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);
}
{code}
> 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