[ 
https://issues.apache.org/jira/browse/SLING-1010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12726019#action_12726019
 ] 

Ian Boston commented on SLING-1010:
-----------------------------------

We have noticed with load testing, that the propagation of jcr events, 
especially in a cluster laggs behind the activity of request threads when there 
is significant activity on multiple threads in the JVM.

If I am reading the patch correctly invalidation will happen on those jcr 
events, which means that where nodes are overloaded with creation activity 
there will be a period of time where the cache says that the item does not 
exist, when infact it does. I suspect that this in turn will lead to  incorrect 
results from the itemExists method. If the code that depends on this is 
defensive, it wont be noticed, but will probably incur extra processing.

I haven't looked at the detailed implementation of 
Collections.synchronizedSet(new HashSet<String>());, but if it does what the 
documentation suggests, then cache.clear() on every jcr event is going to 
generate quite a bit of contention with cache.get. Wouldn't it be better to use 
a ConcurrentHashMap with the slight overhead of having keys and values, and 
avoiding synchronized altogether?


> Add cache to speed up resolution of missing JCR resources
> ---------------------------------------------------------
>
>                 Key: SLING-1010
>                 URL: https://issues.apache.org/jira/browse/SLING-1010
>             Project: Sling
>          Issue Type: Improvement
>          Components: JCR Resource
>            Reporter: Jukka Zitting
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>         Attachments: MissingPathCache.patch
>
>
> As recently discussed [1], I'm trying to speed up resolution of resources 
> that don't exist. The resource resolution algorithm in Sling is very 
> powerful, but it also needs to look at many different paths when a particular 
> resource does not exist.
> I've implemented a simple cache that is designed to work around this 
> performance issue until the speed of such negative repository path lookups 
> has improved.
> [1] http://markmail.org/message/wlamd7xvagaexmzu

-- 
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