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 "Tobias Bocanegra (JIRA)" <ji...@apache.org> on 2013/11/13 08:04:24 UTC

[jira] [Created] (OAK-1172) AbstractTree.getChildrenCount() not very performant due to INTERNAL_NODE_NAMES

Tobias Bocanegra created OAK-1172:
-------------------------------------

             Summary: AbstractTree.getChildrenCount() not very performant due to INTERNAL_NODE_NAMES
                 Key: OAK-1172
                 URL: https://issues.apache.org/jira/browse/OAK-1172
             Project: Jackrabbit Oak
          Issue Type: Bug
            Reporter: Tobias Bocanegra


the AbstractTree.getChildrenCount() does unnecessary checks for hidden names:

{code}
        long count = nodeBuilder.getChildNodeCount(max);
        for (String name : INTERNAL_NODE_NAMES) {
            if (nodeBuilder.hasChildNode(name)) {
                count--;
            }
        }
{code}

this is not optimal, especially because the nodebuilder creates child builders:

{code}
    public boolean hasChildNode(@Nonnull String name) {
        return getChildNode(name).exists();
    }
{code}

Suggest: to extend the NodeBuilder.getChildNodeCount() method to accept an additional flag if to include hidden nodes or not.



--
This message was sent by Atlassian JIRA
(v6.1#6144)