RFR: 8305744: (ch) InputStream returned by Channels.newInputStream should have fast path for ReadbleByteChannel/WritableByteChannel [v3]
Markus KARG
duke at openjdk.org
Mon Apr 10 13:15:42 UTC 2023
On Mon, 10 Apr 2023 09:21:11 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>It has no impact on common cases where the input stream or target is backed by a FileChannel or SocketChannel. I'm not opposed to trying to improve more of these cases, it's just that it's adding more code and complexity for scenarios that may not be too common.
This is correct. My current PR is intended to improve exactly those scenarios where *no* file or socket is involved, as file and socket were optimized already in my earlier PRs over the last years. Nevertheless, I do not see that the complexity or code size added would be *inappropriate*: All we do here simply is adding a loop-over-ByteBuffer, which is simple and straightforward. The complexity solely stems from the combinatory numbers of selectable or not selectable channels.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13387#issuecomment-1501801890
More information about the nio-dev
mailing list