mkwan       2003/03/24 09:18:51

  Modified:    java/src/org/apache/xml/dtm/ref/sax2dtm Tag: XSLTC_DTM
                        SAX2DTM.java SAX2DTM2.java
  Log:
  XSLTC_DTM performance work
  Improvement in DTM building. Make the code more efficient
  in a few expensive interfaces.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.28.2.21 +5 -4      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.28.2.20
  retrieving revision 1.28.2.21
  diff -u -r1.28.2.20 -r1.28.2.21
  --- SAX2DTM.java      28 Feb 2003 16:31:17 -0000      1.28.2.20
  +++ SAX2DTM.java      24 Mar 2003 17:18:51 -0000      1.28.2.21
  @@ -2097,15 +2097,16 @@
         m_textPendingStart = m_chars.size();
         m_coalescedTextType = m_textType;
       }
  -
  -    m_chars.append(ch, start, length);
  -
       // Type logic: If all adjacent text is CDATASections, the
       // concatentated text is treated as a single CDATASection (see
       // initialization above).  If any were ordinary Text, the whole
       // thing is treated as Text. This may be worth %REVIEW%ing.
  -    if (m_textType == DTM.TEXT_NODE)
  +    else if (m_textType == DTM.TEXT_NODE)
  +    {
         m_coalescedTextType = DTM.TEXT_NODE;
  +    }
  +
  +    m_chars.append(ch, start, length);
     }
   
     /**
  
  
  
  1.1.2.31  +15 -7     
xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/Attic/SAX2DTM2.java
  
  Index: SAX2DTM2.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/Attic/SAX2DTM2.java,v
  retrieving revision 1.1.2.30
  retrieving revision 1.1.2.31
  diff -u -r1.1.2.30 -r1.1.2.31
  --- SAX2DTM2.java     21 Mar 2003 18:37:54 -0000      1.1.2.30
  +++ SAX2DTM2.java     24 Mar 2003 17:18:51 -0000      1.1.2.31
  @@ -1825,6 +1825,9 @@
     // The current index into the m_values Vector.
     private int m_valueIndex = 0;
     
  +  // The maximum value of the current node index.
  +  private int m_maxNodeIndex;
  +  
     // Cache the shift and mask values for the SuballocatedIntVectors.
     protected int m_SHIFT;
     protected int m_MASK;
  @@ -1897,6 +1900,8 @@
       // the increment to a bigger number.
       m_values = new Vector(32, 512);
       
  +    m_maxNodeIndex = 1 << DTMManager.IDENT_DTM_NODE_BITS;
  +    
       // Set the map0 values in the constructor.
       m_exptype_map0 = m_exptype.getMap0();
       m_nextsib_map0 = m_nextsib.getMap0();
  @@ -2278,15 +2283,17 @@
         m_prefixMappings.setSize(topContextIndex);
       }
   
  -    int lastNode = m_previous;
  +    // int lastNode = m_previous;
   
       m_previous = m_parents.pop();
   
       // If lastNode is still DTM.NULL, this element had no children
  +    /*
       if (DTM.NULL == lastNode)
         m_firstch.setElementAt(DTM.NULL,m_previous);
       else
         m_nextsib.setElementAt(DTM.NULL,lastNode);
  +    */
   
       popShouldStripWhitespace();
     }
  @@ -2395,9 +2402,11 @@
       int nodeIndex = m_size++;
   
       // Have we overflowed a DTM Identity's addressing range?
  -    if(m_dtmIdent.size() == (nodeIndex>>>DTMManager.IDENT_DTM_NODE_BITS))
  +    //if(m_dtmIdent.size() == (nodeIndex>>>DTMManager.IDENT_DTM_NODE_BITS))
  +    if (nodeIndex == m_maxNodeIndex)
       {
         addNewDTMID(nodeIndex);
  +      m_maxNodeIndex += (1 << DTMManager.IDENT_DTM_NODE_BITS);
       }
   
       m_firstch.addElement(DTM.NULL);
  @@ -2410,10 +2419,6 @@
         m_prevsib.addElement(previousSibling);
       }
   
  -    if (DTM.NULL != previousSibling) {
  -      m_nextsib.setElementAt(nodeIndex,previousSibling);
  -    }
  -
       if (m_locator != null && m_useSourceLocationProperty) {
         setSourceLocation();
       }
  @@ -2430,7 +2435,10 @@
       case DTM.ATTRIBUTE_NODE:
         break;
       default:
  -      if (DTM.NULL == previousSibling && DTM.NULL != parentIndex) {
  +      if (DTM.NULL != previousSibling) {
  +        m_nextsib.setElementAt(nodeIndex,previousSibling);
  +      }
  +      else if (DTM.NULL != parentIndex) {
           m_firstch.setElementAt(nodeIndex,parentIndex);
         }
         break;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to