[jbosscache-commits] JBoss Cache SVN: r7550 - core/trunk/src/main/java/org/jboss/cache/util.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Tue Jan 20 15:14:22 EST 2009


Author: jason.greene at jboss.com
Date: 2009-01-20 15:14:22 -0500 (Tue, 20 Jan 2009)
New Revision: 7550

Modified:
   core/trunk/src/main/java/org/jboss/cache/util/FastCopyHashMap.java
Log:
Update javadoc

Modified: core/trunk/src/main/java/org/jboss/cache/util/FastCopyHashMap.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/FastCopyHashMap.java	2009-01-20 19:56:06 UTC (rev 7549)
+++ core/trunk/src/main/java/org/jboss/cache/util/FastCopyHashMap.java	2009-01-20 20:14:22 UTC (rev 7550)
@@ -34,8 +34,17 @@
 import java.util.Set;
 
 /**
- * A HashMap that is optimized for fast shallow copies.
+ * A HashMap that is optimized for fast shallow copies. If the copy-ctor is
+ * passed another FastCopyHashMap, or clone is called on this map, the shallow
+ * copy can be performed using little more than a single array copy. In order to
+ * accomplish this, immutable objects must be used internally, so update
+ * operations result in slightly more object churn than <code>HashMap</code>.
  *
+ * Note: It is very important to use a smaller load factor than you normally
+ * would for HashMap, since the implementation is open-addressed with linear
+ * probing. With a 50% load-factor a get is expected to return in only 2 probes.
+ * However, a 90% load-factor is expected to return in around 50 probes.
+ *
  * @author Jason T. Greene
  */
 public class FastCopyHashMap<K, V> extends AbstractMap<K, V> implements Map<K, V>, Cloneable, Serializable




More information about the jbosscache-commits mailing list