mkwan       2003/02/18 12:30:40

  Modified:    java/src/org/apache/xalan/xsltc/dom Tag: XSLTC_DTM
                        SAXImpl.java
  Log:
  XSLTC_DTM performance work
  Remove the _parentStack array in SAXImpl. _parentStack contains the same
  information as m_parents in SAX2DTM. There is no need to keep duplicate
  information. We can use m_parents and m_previous to replace _parentStack.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.30  +15 -8     
xml-xalan/java/src/org/apache/xalan/xsltc/dom/Attic/SAXImpl.java
  
  Index: SAXImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/Attic/SAXImpl.java,v
  retrieving revision 1.1.2.29
  retrieving revision 1.1.2.30
  diff -u -r1.1.2.29 -r1.1.2.30
  --- SAXImpl.java      17 Feb 2003 21:18:39 -0000      1.1.2.29
  +++ SAXImpl.java      18 Feb 2003 20:30:39 -0000      1.1.2.30
  @@ -97,9 +97,9 @@
       /* ------------------------------------------------------------------- */
       private final static int INIT_STACK_LENGTH = 64;
   
  -    private int       _parentStackLength    = INIT_STACK_LENGTH;
  -    private int[]     _parentStack          = new int[INIT_STACK_LENGTH];
  -    private int       _sp;
  +    //private int       _parentStackLength    = INIT_STACK_LENGTH;
  +    //private int[]     _parentStack          = new int[INIT_STACK_LENGTH];
  +    //private int       _sp;
   
       // Temporary structures for attribute nodes
       //private int       _currentAttributeNode = 1;
  @@ -1148,6 +1148,7 @@
       /**
        * Sets the current parent
        */
  +     /*
       private void linkParent(final int node)
     {
       if (++_sp >= _parentStackLength)
  @@ -1162,6 +1163,7 @@
       }
       _parentStack[_sp] = node;
     }
  +  */
   
       /**
        * Creates a text-node and checks if it is a whitespace node.
  @@ -1219,8 +1221,8 @@
       {
   
           super.startDocument();
  -        _sp             = 0;
  -        _parentStack[0] = DTMDefaultBase.ROOTNODE;  // root
  +        //_sp             = 0;
  +        //_parentStack[0] = DTMDefaultBase.ROOTNODE;  // root
           //_currentAttributeNode = 1;
   
           definePrefixAndUri(EMPTYSTRING, EMPTYSTRING);
  @@ -1292,8 +1294,10 @@
           handleTextEscaping();
   
           // Get node index and setup parent/child references
  +        /*
           int currentNode = getNumberOfNodes()-1;
           linkParent(currentNode);
  +        */
   
           if (m_wsfilter != null) {
               // Look for any xml:space attributes
  @@ -1301,7 +1305,7 @@
               // might be faster than looping through all attributes. ILENE
               final int index = attributes.getIndex(XMLSPACE_STRING);
               if (index >= 0) {
  -                xmlSpaceDefine(attributes.getValue(index), currentNode);
  +                xmlSpaceDefine(attributes.getValue(index), m_parents.peek());
               }
           }
       }
  @@ -1317,7 +1321,10 @@
   
           // Revert to strip/preserve-space setting from before this element
               // use m_parent??
  -        xmlSpaceRevert(_parentStack[_sp--]);
  +        if (m_wsfilter != null) {
  +            // xmlSpaceRevert(_parentStack[_sp--]);
  +            xmlSpaceRevert(m_previous);
  +        }
       }
   
       /**
  
  
  

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

Reply via email to