8227080: (fs) Files.newInputStream(...).skip(n) is slow
Brian Burkhalter
brian.burkhalter at oracle.com
Tue Jul 2 19:41:40 UTC 2019
Oops, I think that skip() needs to be synchronized. Webrev updated in place.
> On Jul 2, 2019, at 12:18 PM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:
>
> https://bugs.openjdk.java.net/browse/JDK-8227080
> http://cr.openjdk.java.net/~bpb/8227080/webrev.00/
>
> This patch overrides ChannelInputStream.skip(long) to use SeekableByteChannel.position(long) if the ReadableByteChannel instance is a SeekableByteChannel. The performance improvement on my dev machine for skipping the first 2 GB of a local file is about 3.6 x 10^4.
>
> Thanks,
>
> Brian
More information about the nio-dev
mailing list