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
Replace stdlib write/read with send/recv (Fixes #12673) #12679
Conversation
@normanmaurer waiting the CI :) |
transport-native-unix-common/src/main/c/netty_unix_filedescriptor.c
Outdated
Show resolved
Hide resolved
e05d910
to
11090a7
Compare
@normanmaurer comments are welcome, undrafting |
2e647e1
to
b46aa8c
Compare
transport-native-unix-common/src/main/c/netty_unix_filedescriptor.c
Outdated
Show resolved
Hide resolved
transport-classes-epoll/src/main/java/io/netty/channel/epoll/LinuxSocket.java
Outdated
Show resolved
Hide resolved
transport-classes-epoll/src/main/java/io/netty/channel/epoll/LinuxSocket.java
Outdated
Show resolved
Hide resolved
transport-classes-epoll/src/main/java/io/netty/channel/epoll/LinuxSocket.java
Outdated
Show resolved
Hide resolved
transport-classes-epoll/src/main/java/io/netty/channel/epoll/LinuxSocket.java
Outdated
Show resolved
Hide resolved
0370cae
to
302a144
Compare
|
||
@Override | ||
protected int write(final ByteBuffer buf, final int pos, final int limit) throws IOException { | ||
return socket.send(buf, pos, limit); |
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.
That's an hack because SocketWritableByteChannel
is a public API and I cannot introduce a generic param T extends FileDescriptor
on it @normanmaurer
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 really don't like this trick @normanmaurer :( I feel dirty
ca160bd
to
702e3c5
Compare
I've added some |
just remove final |
@franz1981 let me know once I should check again |
702e3c5
to
e220a89
Compare
@normanmaurer fingers crossed! |
@franz1981 please add the numbers here |
transport-classes-epoll/src/main/java/io/netty/channel/epoll/LinuxSocket.java
Outdated
Show resolved
Hide resolved
The firsts load tests using just the receive side (ie read vs recv) shows this improvement: The test used has been Techempower plaintext with quarkus (meaning a full-stack, not just netty) using
vs the full reactive stack. |
Also /cc @Lukasa for visibility |
/cc @trustin |
Interesting, where's the data coming from to suggest that |
Consider @Lukasa that the most benefit come by the different specialization of the syscalls: send/recv are indeed for socket fds, while write/read can be used for other types of fds |
Motivation: The performance Unix write/read paths is more involved (and slower) then the specialized socket send/rcv ones. Modification: Replace Unix write/read paths with send/recv Result: Better performance for single buffer send/recv
e220a89
to
d490a93
Compare
@normanmaurer given I've modified a socket public API I'm prepared to some failure :( |
@normanmaurer re #12679 (comment) I was wrong, so, ready to go! |
Thanks a lot! |
Motivation: The performance Unix write/read paths is more involved (and slower) then the specialized socket send/rcv ones. Modification: Replace Unix write/read paths with send/recv Result: Better performance for single buffer send/recv
Motivation:
The performance Unix write/read paths is more involved (and slower) then the specialized socket send/rcv ones.
Modification:
Replace Unix write/read paths with send/recv
Result:
Better performance for single buffer send/recv