[
https://issues.apache.org/jira/browse/OAK-8141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16809828#comment-16809828
]
Stefan Egli edited comment on OAK-8141 at 4/4/19 1:09 PM:
----------------------------------------------------------
bq. I did not change the contract of Path.getParent(). With a relative path the
first element does not have to be the root anymore and Path.isRoot() cannot be
used for this purpose.
Ok. Might also have been a bit a bigger and risky change, agreed.
So what about changing the current pattern, eg
{noformat}
Path parent = path.getParent();
return parent != null
{noformat}
which used to be
{noformat}
return !denotesRoot(path)
{noformat}
with
{noformat}
return path.isRoot()
{noformat}
Ah, I see, because the full expression is
{noformat}
Path parent = path.getParent();
return parent != null
&& isChildUnchanged(from, to, parent, path.getName());
{noformat}
and that {{parent}} is needed afterwards anyway .. so guarding it with an
explicit NP check looks safer..
was (Author: egli):
bq. I did not change the contract of Path.getParent(). With a relative path the
first element does not have to be the root anymore and Path.isRoot() cannot be
used for this purpose.
Ok. Might also have been a bit a bigger and risky change, agreed.
So what about changing the current pattern, eg
{noformat}
Path parent = path.getParent();
return parent != null
{noformat}
which used to be
{noformat}
return !denotesRoot(path)
{noformat}
with
{noformat}
return path.isRoot()
{noformat}
> Replace String path with custom data type
> -----------------------------------------
>
> Key: OAK-8141
> URL: https://issues.apache.org/jira/browse/OAK-8141
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: documentmk
> Reporter: Marcel Reutegger
> Assignee: Marcel Reutegger
> Priority: Major
> Fix For: 1.12.0
>
> Attachments: OAK-8141.patch
>
>
> DocumentNodeState objects and other related data is currently identified with
> a String path in the various caches in the DocumentNodeStore. Read benchmarks
> like GetDeepNodeTest that only read data from memory are significantly slower
> on a DocumentNodeStore compared to a SegmentNodeStore. In these kind of tests
> the DocumentNodeStore is usually busy with String operations like
> constructing the path for a child node or calculating the hash code for a
> lookup in a cache.
> This issue is about a potential improvement that replaces the use of a plain
> String for the path of a DocumentNodeState and use a custom Path type instead.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)