[ 
https://issues.apache.org/jira/browse/JCR-1213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545805
 ] 

Marcel Reutegger commented on JCR-1213:
---------------------------------------

I also expect that the two patches will have similar performance 
characteristics. In the end both implement the same idea just slightly 
different.

In contrast to your patch mine is nearly twice as large and I had to modify 
many existing signatures. Instead of IndexReader many methods now deal with 
concrete extensions of IndexReader. I'm not sure if this is desirable, but in 
some occasions it helps to better understand whether code deals with content 
just present in one index segment or the overall index.

> When creating a lot of nodes, also remember to "update" a lot of nodes, to 
> create the 'gabs' in the index.

I try to simulate this by running a concurrent thread that modifies content 
while the test runs. I plan to run the tests for an hour or two to see what 
effect it has.

> UUIDDocId cache does not work properly because of weakReferences in 
> combination with new instance for combined indexreader 
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1213
>                 URL: https://issues.apache.org/jira/browse/JCR-1213
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: query
>    Affects Versions: 1.3.3
>            Reporter: Ard Schrijvers
>             Fix For: 1.4
>
>         Attachments: JCR-1213-mreutegg.patch, JCR-1213.patch
>
>
> Queries that use ChildAxisQuery or DescendantSelfAxisQuery make use of 
> getParent() functions to know wether the parents are correct and if the 
> result is allowed. The getParent() is called recursively for every hit, and 
> can become very expensive. Hence, in DocId.UUIDDocId, the parents are cached. 
> Currently,  docId.UUIDDocId's are cached by having a WeakRefence to the 
> CombinedIndexReader, but, this CombinedIndexReader is recreated all the time, 
> implying that a gc() is allowed to remove the 'expensive' cache.
> A much better solution is to not have a weakReference to the 
> CombinedIndexReader, but to a reference of each indexreader segment. This 
> means, that in getParent(int n) in SearchIndex the return 
> return id.getDocumentNumber(this) needs to be replaced by return 
> id.getDocumentNumber(subReaders[i]); and something similar in 
> CachingMultiReader. 
> That is all. Obviously, when a node/property is added/removed/changed, some 
> parts of the cached DocId.UUIDDocId will be invalid, but mainly small indexes 
> are updated frequently, which obviously are less expensive to recompute.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to