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
Dont pool IovArray but just allocate on the fly #10627
Conversation
Motivation: Pooling and re-using IovArray works for now but is not safe in its current form once SQPOLL is used as we can not assume we can re-use the IovArray once we called submit. Modifications: Just allocate the IovArray on the fly when needed by using the ByteBufAllocator Result: Code is safe even with SQPOLL
transport-native-unix-common/src/main/java/io/netty/channel/unix/IovArray.java
Outdated
Show resolved
Hide resolved
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.
I think it would decrease the performance, we could still use Pool IovArrays, as we would save the index of each writeev event iovecArray which will be 'clear' in the cqe, what do you think?
@1Jo1 for now I don't see any perf drop with it... lets keep it simple for now |
transport-native-io_uring/src/main/java/io/netty/channel/uring/IOUringEventLoop.java
Outdated
Show resolved
Hide resolved
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.
Looks great, couple of comments.
I guess we are not worried about non-pooled direct buffers case for now? (sounds fine to me)
...sport-native-io_uring/src/main/java/io/netty/channel/uring/AbstractIOUringStreamChannel.java
Show resolved
Hide resolved
transport-native-unix-common/src/main/java/io/netty/channel/unix/IovArray.java
Show resolved
Hide resolved
@njhill thats right ...addressed your comments as well |
Motivation: Pooling and re-using IovArray works for now but is not safe in its current form once SQPOLL is used as we can not assume we can re-use the IovArray once we called submit. Modifications: Just allocate the IovArray on the fly when needed by using the ByteBufAllocator Result: Code is safe even with SQPOLL
Motivation:
Pooling and re-using IovArray works for now but is not safe in its
current form once SQPOLL is used as we can not assume we can re-use the
IovArray once we called submit.
Modifications:
Just allocate the IovArray on the fly when needed by using the
ByteBufAllocator
Result:
Code is safe even with SQPOLL