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 2015/11/11 18:14:11 UTC

[jira] [Resolved] (OAK-3615) Add initial capacity to StringBuilder used to calculate path of a tree

     [ https://issues.apache.org/jira/browse/OAK-3615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

angela resolved OAK-3615.
-------------------------
       Resolution: Fixed
    Fix Version/s: 1.3.10

Committed revision 1713893 (set to 128 for now)

> Add initial capacity to StringBuilder used to calculate path of a tree
> ----------------------------------------------------------------------
>
>                 Key: OAK-3615
>                 URL: https://issues.apache.org/jira/browse/OAK-3615
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core
>            Reporter: angela
>            Assignee: angela
>            Priority: Minor
>             Fix For: 1.3.10
>
>
> while benchmarking permission evaluation on the oak level (without having oak-jcr overhead), i spotted that the {{StringBuilder}} used to calculate the path of a tree often needs to increase it's capacity. Extract from the profiler info reported in oak-run:
> {code}
> at java.util.Arrays.copyOf(Arrays.java:2882)
> at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
> at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
> at java.lang.StringBuilder.append(StringBuilder.java:119)
> at org.apache.jackrabbit.oak.plugins.tree.impl.AbstractTree.buildPath(AbstractTree.java:206)
> at org.apache.jackrabbit.oak.plugins.tree.impl.AbstractTree.buildPath(AbstractTree.java:205)
> at org.apache.jackrabbit.oak.plugins.tree.impl.AbstractTree.getPath(AbstractTree.java:197)
> {code}
> Would it make sense to initialize the {{StringBuilder}} with some initial capacity? Afaik the default is 16 which doesn't seem sufficient for a default path as we are experiencing them in an Oak instance.
> [~mduerig], what do you think?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)