Author: markt
Date: Sat Sep 22 22:28:32 2012
New Revision: 1388913

URL: http://svn.apache.org/viewvc?rev=1388913&view=rev
Log:
Remove unnecessary wrap with ByteBuffer. Contributes ~4% of the garbage 
generated with a simple ab load test.

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java?rev=1388913&r1=1388912&r2=1388913&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java Sat 
Sep 22 22:28:32 2012
@@ -375,9 +375,7 @@ public class InternalNioOutputBuffer ext
 
     private int transfer(byte[] from, int offset, int length, ByteBuffer to) {
         int max = Math.min(length, to.remaining());
-        ByteBuffer tmp = ByteBuffer.wrap(from, offset, max);
-        tmp.limit (tmp.position() + max);
-        to.put (tmp);
+        to.put(from, offset, max);
         return max;
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to