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

Thomas Mueller commented on OAK-9780:
-------------------------------------

Findings so far:
* I changed prefetch a bit to only download entries that are _not_ yet in the 
cache.
* Prefetch of few elements seems unnecessary
* My finding so far is that with prefetch, after clearing the cache, a query is 
much faster than without prefetch, but then subsequent runs (with cache) are 
slower than without prefetch. I don't have a good explanation for this, and 
will investigate.
* I think we should soon consider adding the code to trunk, but _disable_ this 
new feature _by default_, so that we can more easily benchmark.

{noformat}
    @Override
    public <T extends Document> void prefetch(Collection<T> collection,
            Iterable<String> keysToPrefetch) {
        
        ArrayList<String> keys = new ArrayList<>();
        for (String k : keysToPrefetch) {
            if (nodesCache.getIfPresent(k) == null) {
                keys.add(k);
            }
        }
        if (keys.size() < minPrefetch) {
            return;
        }
{noformat}

> 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