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 "angela (JIRA)" <ji...@apache.org> on 2013/11/13 12:16:20 UTC
[jira] [Resolved] (OAK-1172) AbstractTree.getChildrenCount() not
very performant due to INTERNAL_NODE_NAMES
[ https://issues.apache.org/jira/browse/OAK-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
angela resolved OAK-1172.
-------------------------
Resolution: Fixed
> 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)