New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ChunkedNioFile can use absolute FileChannel::read to read chunks #9592
Conversation
a1cc125
to
cfb2111
Compare
Can one of the admins verify this patch? |
I see that the original version was very naive (mine too) by changing |
cfb2111
to
b916099
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@netty-bot test this please |
Motivation: Users can reuse the same FileChannel for different ChunkedNioFile instances without being worried that FileChannel::position will be changed concurrently by them. In addition, FileChannel::read with absolute position allows to use on *nix pread that is more efficient then fread. Modifications: Always use absolute FileChannel::read ops Result: Faster and more flexible uses of FileChannel for ChunkedNioFile
b916099
to
da8d633
Compare
@netty-bot test this please |
Motivation: Users can reuse the same FileChannel for different ChunkedNioFile instances without being worried that FileChannel::position will be changed concurrently by them. In addition, FileChannel::read with absolute position allows to use on *nix pread that is more efficient then fread. Modifications: Always use absolute FileChannel::read ops Result: Faster and more flexible uses of FileChannel for ChunkedNioFile
@franz1981 thanks a lot! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job :)
Motivation:
Users can reuse the same FileChannel for different ChunkedNioFile
instances without being worried that FileChannel::position will be
changed concurrently by them.
In addition, FileChannel::read with absolute position allows to
use on *nix pread that is more efficient then fread.
Modifications:
Always use absolute FileChannel::read ops
Result:
Faster and more flexible uses of FileChannel for ChunkedNioFile