jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1002589 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateReferenceCache.java
Date Wed, 29 Sep 2010 12:28:42 GMT
Author: jukka
Date: Wed Sep 29 12:28:42 2010
New Revision: 1002589

URL: http://svn.apache.org/viewvc?rev=1002589&view=rev
Log:
JCR-2699: Improve read/write concurrency

Revert back to weak references in ItemStateReferenceCache as using soft references seems to
cause notable performance drop in the TCK test run

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateReferenceCache.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateReferenceCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateReferenceCache.java?rev=1002589&r1=1002588&r2=1002589&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateReferenceCache.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateReferenceCache.java
Wed Sep 29 12:28:42 2010
@@ -54,7 +54,12 @@ public class ItemStateReferenceCache imp
      */
     @SuppressWarnings("unchecked")
     private final Map<ItemId, ItemState> refs =
-        new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
+        // I tried using soft instead of weak references here, but that
+        // seems to have some unexpected performance consequences (notable
+        // increase in the JCR TCK run time). So even though soft references
+        // are generally recommended over weak references for caching
+        // purposes, it seems that using weak references is safer here.
+        new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
 
     /**
      * secondary cache that automatically flushes entries based on some



Mime
View raw message