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

Brian Burkhalter bpb at openjdk.java.net
Thu Apr 28 00:51:34 UTC 2022


On Thu, 28 Apr 2022 00:08:18 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: Revert all changes except mapped transfer threshold

As discussed in [JDK-8282039](https://bugs.openjdk.java.net/browse/JDK-8282039), using `copy_file_range(2)` on Linux does not appear to offer any advantage over `sendfile(2)`, at least for use cases in the JDK. So this PR has now been winnowed down to just adding a size threshold below which a read-write copy loop will be used instead of memory mapping to perform the transfer.

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

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


More information about the nio-dev mailing list