jira-importer opened a new issue, #1039:
URL: https://github.com/apache/httpcomponents-core/issues/1039

   **[Ion 
Moldovan](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=herrmess)**
 opened 
**[HTTPCORE-518](https://issues.apache.org/jira/browse/HTTPCORE-518?redirect=false)**
 and commented
   
   The doubling of the buffer size every time it exceeds its previous size is a 
good way for small buffers, but quite wasteful for large sizes.
   
   A more modest growth (e.g. 1.25 x Previous Size)  when sizes are > 32MB 
would be a nice improvement.
   
   Proposed solution:
   
   ```java
   /**
   * Expands buffer's capacity.
   *
   * @throws BufferOverflowException in case we get over the maximum allowed 
value
   */
   protected void expand() throws BufferOverflowException {
     int newcapacity;
     if (this.buffer.capacity() <= (32 << 20) ) {
       newcapacity = (this.buffer.capacity() + 1) << 1;
     } else {
       newcapacity = (this.buffer.capacity() + 1) * 5 / 4;
     }
   ...
   }
   ```
   
    What do you think?
   
   
   ---
   No further details from 
[HTTPCORE-518](https://issues.apache.org/jira/browse/HTTPCORE-518?redirect=false)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to