Joel Richard created OAK-2758:
---------------------------------

             Summary: Performance: 
                 Key: OAK-2758
                 URL: https://issues.apache.org/jira/browse/OAK-2758
             Project: Jackrabbit Oak
          Issue Type: Improvement
          Components: core
    Affects Versions: 1.2
            Reporter: Joel Richard
            Priority: Critical


While I was analysing Sling's rendering performance, I noticed that it would 
help a lot to implement a cache for the ResourceResolver. For some pages it 
almost doubled the rendering performance. This made me wondering whether Oak's 
read performance could still be improved.

I noticed that a lot of time is spent in MutableTree#getTree and 
MemoryNodeBuilder#getChildNode and have implemented a specific cache for them. 
These two caches improve the read performance up to 4 times and do not break 
any oak-core tests.

Here the benchmark results for ReadDeepTreeTest:

{code}
Fixtures: Oak-Tar
Admin User: false
Runtime: 5
Num Items: 1000
Concurrency: 1,2,4
Random User: true
Profiling: false
--------------------------------------
Executing benchmarks as admin: false on Oak-Tar
-----------------------------------------------------------
# ReadDeepTreeTest          ,      C,    min,    10%,    50%,    90%,    max,   
   N
Oak-Tar                     ,      1,     16,     16,     17,     19,     22,   
 290
Oak-Tar                     ,      2,     23,     29,     44,     68,    115,   
 216
Oak-Tar                     ,      4,     24,     43,     97,    154,    232,   
 207
{code}

The same results with my changes:

{code}
# ReadDeepTreeTest          ,      C,    min,    10%,    50%,    90%,    max,   
   N
Oak-Tar                     ,      1,      4,      4,      5,      5,     15,   
1038
Oak-Tar                     ,      2,     10,     14,     16,     20,     60,   
 577
Oak-Tar                     ,      4,     13,     27,     32,     40,     69,   
 605
{code}

I have also implemented another cache for properties, but it didn't really help 
and broke some tests.

The experimental patch is attached. It's not meant to be applied, but just to 
point out areas with potential for improvement.



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

Reply via email to