Improving perf of FileChannel.transferTo() on Windows
Kirk Shoop (MS OPEN TECH)
Kirk.Shoop at microsoft.com
Tue Nov 11 18:04:44 UTC 2014
From: Alan Bateman [mailto:Alan.Bateman at oracle.com]
I've created JDK-8064407 to track this.
Thanks! Feel free to ask/teach us to open these in the future.
One idea to integrate this is to add a canTransferTo(SelectableChannel) method to sun.nio.ch.FileDispatcher. That way the check for whether the channel is blocking and the other Windows-specific configuration can go into the Windows FileDispatcherImpl (keep it out of FileChannelImpl needing native methods for the other platforms).
One other point is that trasnferTo is specified not to change the channel's position. This means you will need to synchronize on the positionLock and restore the channel position after the TransmitFile. I don't know if you've figured out how to run jtreg to run tests but if you run the :jdk_nio group and specify -vmoption:-Djdk.net.enableFastFileTransfer=true to jtreg then you'll run all the relevant tests with this option.
Valery applied both of your suggestions and was able to run the jtreg tests with this new webrev:
https://openjdkcontrib.blob.core.windows.net/transferto/webrev-20141111.zip
Thanks!
Kirk
Developer
Microsoft Open Technologies, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20141111/d0e9bd1c/attachment.html>
More information about the nio-dev
mailing list