-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
Allow efficient writing of CompositeByteBuf when using native epoll tran... #2789
Conversation
@trustin please review |
@trustin ok now it is correct. please review |
// passed to write. | ||
buf = newDirectBuffer(buf); | ||
assert buf.hasMemoryAddress(); | ||
boolean isDirect = buf.isDirect(); |
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.
This should not be evaluated when buf.hasMemoryAddress()
returns true or PlatformDependent.hasUnsafe()
returns true. We should not evaluate it at least when buf.hasMemoryAddress()
returns true.
Looks good. Please merge once my comment is addressed. |
5965394
to
d93b8eb
Compare
…ransport. Motivation: There were no way to efficient write a CompositeByteBuf as we always did a memory copy to a direct buffer in this case. This is not needed as we can just write a CompositeByteBuf as long as all the components are buffers with a memory address. Modifications: - Write CompositeByteBuf which contains only direct buffers without memory copy - Also handle CompositeByteBuf that have more components then 1024. Result: More efficient writing of CompositeByteBuf.
d93b8eb
to
6f09efc
Compare
@trustin cherry-picked into 4.0, 4.1 and master after addressing your comment |
...sport.
Motivation:
There were no way to efficient write a CompositeByteBuf as we always did a memory copy to a direct buffer in this case. This is not needed as we can just write a CompositeByteBuf as long as all the components are buffers with a memory address.
Modifications:
Result:
More efficient writing of CompositeByteBuf.