Improving perf of FileChannel.transferTo() on Windows
Kirk Shoop (MS OPEN TECH)
Kirk.Shoop at microsoft.com
Wed Oct 15 16:40:56 UTC 2014
From: Alan Bateman [mailto:Alan.Bateman at oracle.com]
There have been attempts in the past to use TransmitFile but they ran into a number of issues, I think it was mostly semantics differences compared to sendfile. It was a long time ago but I think one example was sending HTTP headers via write following by the HTTP body with transferTo. If I recall correctly then TransmitFile bypassed the socket buffer. Do you anything about that?
That is good to know. I was not aware of that. Where can I look for previous discussion of this?
If TransmitFile does bypass the socket buffer, my first thought is that doing a flush before calling TransmitFile would avoid the issue. I do expect that forcing a flush would cause a perf issue. A mitigation for that would be to only use the flush/transmitfile path when the file to send is large enough to hide the cost of the flush. This would require having access to the file size. Has this been tried before?
Valery should chime in if he has more information or thoughts.
Kirk
Developer
Microsoft Open Technologies, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20141015/161dba47/attachment.html>
More information about the nio-dev
mailing list