jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Sedding (JIRA)" <j...@apache.org>
Subject [jira] [Created] (OAK-7668) Optimization: SegmentNodeState#fastEquals should compare getStableIdBytes instead of getStableId
Date Fri, 27 Jul 2018 13:56:00 GMT
Julian Sedding created OAK-7668:
-----------------------------------

             Summary: Optimization: SegmentNodeState#fastEquals should compare getStableIdBytes
instead of getStableId
                 Key: OAK-7668
                 URL: https://issues.apache.org/jira/browse/OAK-7668
             Project: Jackrabbit Oak
          Issue Type: Improvement
          Components: segment-tar
    Affects Versions: 1.9.6
            Reporter: Julian Sedding


I have observed via stack trace sampling that during the installation of a Vault package with
many small nodes on an otherwise quiet system, about 1/4 of stack traces had the following
lines on the top (this was on Oak 1.6.11, but reading the code it applies equally on trunk):

{code}
at java.lang.String.valueOf(String.java:2994)
at java.lang.StringBuilder.append(StringBuilder.java:131)
at org.apache.jackrabbit.oak.segment.SegmentNodeState.getStableId(SegmentNodeState.java:124)+
at org.apache.jackrabbit.oak.segment.SegmentNodeState.fastEquals(SegmentNodeState.java:632)
...
{code}

I suggest comparing the result of {{SegmentNodeState#getStableIdBytes}} instead of {{SegmentNodeState#getStableId}},
which bypasses building the String representation.

So far I have no proof in the form of a benchmark, but it seems quite clear that this change
will result in less work being performed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message