jkesselm 01/12/13 10:08:42
Modified: java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM.java
Log:
Part 1 of 2: Reducing initial space requirements of a DTM. This may
involve a slight performance hit, but should help stylesheets which
generate a lot of Result Tree Fragment. Part 2 of this change will be
checked in after I resolve a bug in whitespace normalization.
Note that a better long-term answer will be to reduce the number of
DTMs tied up as RTFs, by doing a better job of discarding or reusing
them when we're done with them. There are some issues regarding
exactly what their lifetimes will be when assigned to variables,
especially when one variable is used to build another, which we
need to address before we can make that change.
Revision Changes Path
1.22 +13 -2
xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Index: SAX2DTM.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- SAX2DTM.java 2001/12/05 14:54:13 1.21
+++ SAX2DTM.java 2001/12/13 18:08:42 1.22
@@ -107,9 +107,16 @@
/**
* All the character content, including attribute values, are stored in
* this buffer.
- * %REVIEW% Should this have an option of being shared?
+ *
+ * %REVIEW% Should this have an option of being shared across DTMs?
+ * Sequentially only; not threadsafe... Currently, I think not.
+ *
+ * %REVIEW% Initial size should be pushed way down to reduce weight of
RTFs,
+ * pending reduction in number of RTFs.
+ * However, I've got a bug in whitespace normalization to fix first.
*/
private FastStringBuffer m_chars = new FastStringBuffer(13, 13);
+ //private FastStringBuffer m_chars = new FastStringBuffer(5, 13);
/** This vector holds offset and length data. */
protected SuballocatedIntVector m_data;
@@ -231,7 +238,11 @@
super(mgr, source, dtmIdentity, whiteSpaceFilter,
xstringfactory, doIndexing);
- m_data = new SuballocatedIntVector(doIndexing ? (1024*2) : 512, 1024);
+ // %REVIEW% Initial size pushed way down to reduce weight of RTFs
+ // (I'm not entirely sure 0 would work, so I'm playing it safe for now.)
+ //m_data = new SuballocatedIntVector(doIndexing ? (1024*2) : 512, 1024);
+ m_data = new SuballocatedIntVector(32, 1024);
+
m_data.addElement(0); // Need placeholder in case index into here must
be <0.
m_dataOrQName = new SuballocatedIntVector(m_initialblocksize);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]