Regis Xu (JIRA) wrote:
[classlib][nio] optimize SocketChannel.write(ByteBuffer[], int, int) by writev
------------------------------------------------------------------------------
Key: HARMONY-6328
URL: https://issues.apache.org/jira/browse/HARMONY-6328
Project: Harmony
Issue Type: Improvement
Components: Classlib
Affects Versions: 5.0M11
Reporter: Regis Xu
SocketChannel.write(ByteBuffer[], int, int) can be optimized by using writev,
which can write an array of buffer to socket without any stage buffer. If all
passed in ByteBuffer is direct buffer, they can be passed to system call
directly without any copies.
I tested the patch on Windows, Linux and AIX, nio tests are all passed. I know
someone (Oliver, Kevin and Ray) are working on z/OS, I'm not sure whether writev
will work on it, so it would be great if someone can test the patch on z/OS
before committing it.
And also, any comments and suggestions about this improvement are welcome :)
--
Best Regards,
Regis.