xml-xalan-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zong...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xml/dtm/ref DTMDefaultBase.java
Date Tue, 10 Dec 2002 18:48:45 GMT
zongaro     2002/12/10 10:48:45

  Modified:    java/src/org/apache/xml/dtm/ref Tag: XSLTC_DTM
                        DTMDefaultBase.java
  Log:
  Reduced the initial sizes of SuballocatedIntVectors used for m_dtmIdent and
  namespace management.  In both cases default size SuballocatedIntVectors were
  being used, which entails a block size of 2048.  For m_dtmIdent, that value
  would only overflow into a second block for a document with 2048*65536 nodes.
  Using a smaller size improves DTM build time for smaller documents, without
  penalizing most larger documents.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.28.2.6  +18 -11    xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBase.java
  
  Index: DTMDefaultBase.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBase.java,v
  retrieving revision 1.28.2.5
  retrieving revision 1.28.2.6
  diff -u -r1.28.2.5 -r1.28.2.6
  --- DTMDefaultBase.java	26 Nov 2002 15:02:29 -0000	1.28.2.5
  +++ DTMDefaultBase.java	10 Dec 2002 18:48:44 -0000	1.28.2.6
  @@ -160,7 +160,7 @@
   
     /** The document identity number(s). If we have overflowed the addressing
      * range of the first that was assigned to us, we may add others. */
  -  protected SuballocatedIntVector m_dtmIdent=new SuballocatedIntVector();
  +  protected SuballocatedIntVector m_dtmIdent=new SuballocatedIntVector(32);
   
     /** The mask for the identity.
         %REVIEW% Should this really be set to the _DEFAULT? What if
  @@ -1215,10 +1215,10 @@
         {
   
           // First
  -        m_namespaceDeclSetElements=new SuballocatedIntVector();
  +        m_namespaceDeclSetElements=new SuballocatedIntVector(32);
           m_namespaceDeclSetElements.addElement(elementNodeIndex);
           m_namespaceDeclSets=new Vector();
  -        nsList=new SuballocatedIntVector();
  +        nsList=new SuballocatedIntVector(32);
           m_namespaceDeclSets.addElement(nsList);
         }
       else
  @@ -1235,22 +1235,30 @@
       if(nsList==null)
         {
           m_namespaceDeclSetElements.addElement(elementNodeIndex);
  -        nsList=new SuballocatedIntVector();
  -        m_namespaceDeclSets.addElement(nsList);
   
  -        SuballocatedIntVector inherited= findNamespaceContext(_parent(elementNodeIndex));
  +        SuballocatedIntVector inherited =
  +                                findNamespaceContext(_parent(elementNodeIndex));
   
  -        if(inherited!=null)
  -          {
  +        if (inherited!=null) {
               // %OPT% Count-down might be faster, but debuggability may
               // be better this way, and if we ever decide we want to
               // keep this ordered by expanded-type...
               int isize=inherited.size();
  +
  +            // Base the size of a new namespace list on the
  +            // size of the inherited list - but within reason!
  +            nsList=new SuballocatedIntVector(Math.max(Math.min(isize+16,2048),
  +                                                      32));
  +
               for(int i=0;i<isize;++i)
                 {
                   nsList.addElement(inherited.elementAt(i));
                 }
  -          }
  +        } else {
  +            nsList=new SuballocatedIntVector(32);
  +        }
  +
  +        m_namespaceDeclSets.addElement(nsList);
         }
   
       // Handle overwriting inherited.
  @@ -1314,8 +1322,7 @@
             }
   
             if (candidate == uppermostNSCandidateID) {
  -            return (SuballocatedIntVector)m_namespaceDeclSets
  -                                                .elementAt(wouldBeAt);
  +            return (SuballocatedIntVector)m_namespaceDeclSets.elementAt(wouldBeAt);
             }
           }
   
  
  
  

---------------------------------------------------------------------
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