RFR: 8274112: (fc) Tune FileChannel.transferTo() [v4]

Brian Burkhalter bpb at openjdk.java.net
Mon Nov 1 22:34:13 UTC 2021


On Mon, 25 Oct 2021 16:57:41 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Please consider this patch which would improve the performance of
>> `FileChannel.transferTo()` on macOS and Windows.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8274112: Make transferTo0() static; remove check for null FileDescriptor

I believe that prior to publishing this PR I tested the case of doing the read-write transfer in Java and it did not afford the same sort of performance improvement as what is proposed here. This version was inspired more by the native code underlying the Unix implementation of Files.copy() (UnixCopyFile.c) which has exactly the same sort of native read-write loop in it. The question here then becomes whether the performance improvement is worth the extra native code.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5623


More information about the nio-dev mailing list