[ 
https://issues.apache.org/jira/browse/OAK-9780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17556671#comment-17556671
 ] 

Marcel Reutegger commented on OAK-9780:
---------------------------------------

This is the CacheWarmingTest from branch 
https://github.com/apache/jackrabbit-oak/tree/OAK-9780

Meanwhile I updated the branch and the CacheWarmingTest now logs time for each 
of the steps. I also added the test you asked for. The output without extra 
latency now looks like this on my machine:
{noformat}
=== doSimple( cleanCaches = true, prefetch = true )
after init       -> createOrUpdateCalls = 0, findCalls = 0, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 1, 1,335 s
before merge     -> createOrUpdateCalls = 3, findCalls = 7, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 1, 429,4 ms
after merge      -> createOrUpdateCalls = 22, findCalls = 5129, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 699, 4,098 s
after invalidate -> createOrUpdateCalls = 1, findCalls = 1, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 1, 43,75 ms
after prefetch   -> createOrUpdateCalls = 0, findCalls = 0, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 1, 260,9 ms
read             -> createOrUpdateCalls = 0, findCalls = 20480, queryCalls = 7, 
removalCalls = 0, rawFindCalls = 7, 294,1 ms
=== doSimple( cleanCaches = false, prefetch = false )
after init       -> createOrUpdateCalls = 0, findCalls = 0, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 1, 923,6 ms
before merge     -> createOrUpdateCalls = 3, findCalls = 7, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 1, 256,8 ms
after merge      -> createOrUpdateCalls = 22, findCalls = 5128, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 699, 4,050 s
read             -> createOrUpdateCalls = 1, findCalls = 15362, queryCalls = 7, 
removalCalls = 0, rawFindCalls = 7, 168,7 ms
=== doSimple( cleanCaches = true, prefetch = false )
after init       -> createOrUpdateCalls = 0, findCalls = 0, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 1, 850,4 ms
before merge     -> createOrUpdateCalls = 3, findCalls = 7, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 1, 235,6 ms
after merge      -> createOrUpdateCalls = 22, findCalls = 5127, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 699, 3,528 s
after invalidate -> createOrUpdateCalls = 0, findCalls = 0, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 0, 18,39 ms
read             -> createOrUpdateCalls = 1, findCalls = 20488, queryCalls = 7, 
removalCalls = 0, rawFindCalls = 15370, 3,472 s
=== doSimple( cleanCaches = false, prefetch = true )
after init       -> createOrUpdateCalls = 0, findCalls = 0, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 1, 882,5 ms
before merge     -> createOrUpdateCalls = 3, findCalls = 7, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 1, 211,8 ms
after merge      -> createOrUpdateCalls = 22, findCalls = 5127, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 699, 3,587 s
after prefetch   -> createOrUpdateCalls = 0, findCalls = 0, queryCalls = 0, 
removalCalls = 0, rawFindCalls = 0, 25,50 ms
read             -> createOrUpdateCalls = 0, findCalls = 15360, queryCalls = 7, 
removalCalls = 0, rawFindCalls = 7, 161,2 ms
{noformat}

I think we need to be careful with these timings. JVM hotspot optimization may 
kick in at some point and initial numbers can look worse than they actually are.

> PoC for DocumentNodeStore cache warming
> ---------------------------------------
>
>                 Key: OAK-9780
>                 URL: https://issues.apache.org/jira/browse/OAK-9780
>             Project: Jackrabbit Oak
>          Issue Type: Task
>          Components: documentmk
>            Reporter: Stefan Egli
>            Assignee: Stefan Egli
>            Priority: Major
>
> Proof of concept of cache warming for DocumentNodeStore. Goal is for indexing 
> to warm up the cache for a select few eg paths to allow for faster 
> iterating/reading of the same eg paths later on



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to