Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 36511 invoked from network); 4 Feb 2007 05:32:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Feb 2007 05:32:27 -0000 Received: (qmail 33953 invoked by uid 500); 4 Feb 2007 05:32:34 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 33578 invoked by uid 500); 4 Feb 2007 05:32:33 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 33568 invoked by uid 99); 4 Feb 2007 05:32:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Feb 2007 21:32:33 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Feb 2007 21:32:25 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C091571429F for ; Sat, 3 Feb 2007 21:32:05 -0800 (PST) Message-ID: <5266051.1170567125785.JavaMail.jira@brutus> Date: Sat, 3 Feb 2007 21:32:05 -0800 (PST) From: "Martijn Hendriks (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Updated: (JCR-731) Can the caching mechanism be improved? In-Reply-To: <5561703.1170427325812.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-731?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martijn Hendriks updated JCR-731: --------------------------------- Attachment: JCR-731.diff Hi Stefan, Here is the diff w.r.t JackRabbit 1.2.1. Please note that we also applied Jaka Jaksic's patch for JCR-725 to the CacheManager. Martijn > Can the caching mechanism be improved? > -------------------------------------- > > Key: JCR-731 > URL: https://issues.apache.org/jira/browse/JCR-731 > Project: Jackrabbit > Issue Type: Improvement > Components: core > Reporter: Martijn Hendriks > Attachments: CacheManager.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 > creative online development B.V. > > t: 024 - 3888 261 > f: 024 - 3888 621 > e: martijnh@gx.nl > > 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.