jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "angela (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (OAK-3615) Add initial capacity to StringBuilder used to calculate path of a tree
Date Wed, 11 Nov 2015 17:14:11 GMT

     [ 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)

Mime
View raw message