Avoid double copying data in ChannelDescriptor#read()
-----------------------------------------------------

                 Key: JRUBY-2423
                 URL: http://jira.codehaus.org/browse/JRUBY-2423
             Project: JRuby
          Issue Type: Improvement
            Reporter: Wayne Meissner
            Assignee: Thomas E Enebo
            Priority: Trivial
         Attachments: ChannelDescriptor.patch

ChannelDescriptor#read currently reads into a temporary ByteBuffer, then copies 
that into the ByteList. 

For the optimistic case - where read() will read the requested number of bytes 
- reading directly into the ByteList avoids one copy.

Where read returns -1 or 0, this patch results in a superfluous allocation and 
(maybe) arraycopy.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to