[
https://issues.apache.org/jira/browse/JCR-731?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jukka Zitting updated JCR-731:
------------------------------
Status: Patch Available (was: Open)
> Can the caching mechanism be improved?
> --------------------------------------
>
> Key: JCR-731
> URL: https://issues.apache.org/jira/browse/JCR-731
> Project: Jackrabbit Content Repository
> Issue Type: Improvement
> Components: jackrabbit-core
> Reporter: Martijn Hendriks
> Attachments: CacheManager.java, CachingTest.java, JCR-731.diff,
> MLRUItemStateCache.java, SharedItemStateManager.java
>
>
> Hi all,
> We've identified the method "getNonVirtualItemState" in the
> SharedItemStateManager as a hot spot in our application. To avoid the
> contention in "getNonVirtualItemState", we have pulled the isCached call out
> of the synchronized block and re-implemented the MLRUItemStateCache. It uses
> a HashMap that contains the ItemId-ItemState mapping and a ReadWriteLock to
> replace all synchronized blocks in the code. The implementation of
> "shrinkIfRequired" unfortunatly got much more expensive as the entryset of
> the HashMap must be sorted by accesscount. This method then clearly is a
> bottleneck. We solved this by changing the CacheManager a bit: the
> "resizeAll" method avoids the eviction of items out of caches as long as
> possible.
> These changes work out really well for our application. I have attached the
> changed files; comments/feedback are very welcome!
> Regards,
> Martijn Hendriks
> <GX> creative online development B.V.
>
> t: 024 - 3888 261
> f: 024 - 3888 621
> e: [email protected]
>
> Wijchenseweg 111
> 6538 SW Nijmegen
> http://www.gx.nl/
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.