xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minc...@apache.org
Subject svn commit: r475904 - /xalan/java/trunk/src/org/apache/xml/dtm/ref/CustomStringPool.java
Date Thu, 16 Nov 2006 20:09:39 GMT
Author: minchau
Date: Thu Nov 16 12:09:39 2006
New Revision: 475904

URL: http://svn.apache.org/viewvc?view=rev&rev=475904
Log:
Adding comments in the javadoc that perhaps 
a field can be changed from Hashtable to HashMap 
for performance reasons.

Just a bread crumb of information for the next guy.

Modified:
    xalan/java/trunk/src/org/apache/xml/dtm/ref/CustomStringPool.java

Modified: xalan/java/trunk/src/org/apache/xml/dtm/ref/CustomStringPool.java
URL: http://svn.apache.org/viewvc/xalan/java/trunk/src/org/apache/xml/dtm/ref/CustomStringPool.java?view=diff&rev=475904&r1=475903&r2=475904
==============================================================================
--- xalan/java/trunk/src/org/apache/xml/dtm/ref/CustomStringPool.java (original)
+++ xalan/java/trunk/src/org/apache/xml/dtm/ref/CustomStringPool.java Thu Nov 16 12:09:39
2006
@@ -36,6 +36,12 @@
  * DTMStringPool, since it is both much more memory-hungry and probably slower
  * -- especially in JDK 1.1.x, where Hashtable is synchronized. We need to
  * either justify this implementation or discard it.
+ * 
+ * %REVIEW% Xalan-J has dropped support for 1.1.x and we can now use
+ * the colletion classes in 1.2, such as java.util.HashMap which is
+ * similar to java.util.Hashtable but not synchronized. For performance reasons
+ * one could change m_stringToInt to be a HashMap, but is it OK to do that?
+ * Are such CustomStringPool objects already used in a thread-safe way?
  *
  * <p>Status: In progress, under discussion.</p>
  * */
@@ -43,7 +49,7 @@
         //final Vector m_intToString;
         //static final int HASHPRIME=101;
         //int[] m_hashStart=new int[HASHPRIME];
-        final Hashtable m_stringToInt = new Hashtable();
+        final Hashtable m_stringToInt = new Hashtable(); // can this be a HashMap instead?
         public static final int NULL=-1;
 
         public CustomStringPool()



---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message