nacho       01/03/09 17:20:24

  Modified:    src/share/org/apache/jasper/runtime BodyContentImpl.java
  Log:
    One last performance update to the previous commit.
  
    Double the buffer size on a realloc instead of incrementing the length.
  
    Submitted by:       Andrew Gilbert [[EMAIL PROTECTED]]
  
  Revision  Changes    Path
  1.8       +3 -3      
jakarta-tomcat/src/share/org/apache/jasper/runtime/BodyContentImpl.java
  
  Index: BodyContentImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/BodyContentImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BodyContentImpl.java      2001/03/01 00:59:54     1.7
  +++ BodyContentImpl.java      2001/03/10 01:20:23     1.8
  @@ -88,7 +88,7 @@
           super(writer);
        cb = new char[bufferSize];
        nextChar = 0;
  -    }
  +      }
   
       /**
        * Write a single character.
  @@ -105,7 +105,7 @@
   
       private void reAllocBuff (int len) {
           //Need to re-allocate the buffer since it is to be
  -     //unbounded according to the updated spec..
  +     //unbounded according to the updated spec..
   
           char[] tmp = null;
   
  @@ -113,7 +113,7 @@
   
        if (len <= Constants.DEFAULT_BUFFER_SIZE) {
            tmp = new char [bufferSize + Constants.DEFAULT_BUFFER_SIZE];
  -         bufferSize += Constants.DEFAULT_BUFFER_SIZE;
  +         bufferSize = bufferSize * 2;
        } else {
            tmp = new char [bufferSize + len];
            bufferSize += len;
  
  
  

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

Reply via email to