You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks a lot for the work you've done in this crate!
I currently use tokio-tungstenite to write a high-performance client for benchmarking multiple Websocket libraries. The client-side code connects ~10_000 ws connections to the server and writes a batch of messages. When profiling the client code, I found the repeated call to __libc_sendto syscall which adds a lot of overhead given the test setup. For performance reasons, I wanted to write the batch of messages using a single writev syscall.
Looking at the code I found that the WebsocketStream implements Sink for an underlying Stream : AsyncRead + AsyncWrite
As for your question - you are touching on a topic that is a known problem in tokio-tungstenite. Unfortunately, we can't add such support easily due to a major constrain of our underlying library tungstenite operating on Read + Write streams, in other words, the actual reading/writing happens inside tungstenite and we have a kludge in tokio-tungstenite to implement Read + Write for AsyncRead + AsyncWrite types that don't implement Read + Write (the requirement from tungstenite).
I've summarized most of the information related to performance here: snapview/tungstenite-rs#352 (comment). We have not addressed these issues yet as no one of the current maintainers actively uses the library, so it has stalled a bit.
Hello,
Thanks a lot for the work you've done in this crate!
I currently use
tokio-tungstenite
to write a high-performance client for benchmarking multiple Websocket libraries. The client-side code connects ~10_000 ws connections to the server and writes a batch of messages. When profiling the client code, I found the repeated call to__libc_sendto
syscall which adds a lot of overhead given the test setup. For performance reasons, I wanted to write the batch of messages using a singlewritev
syscall.Looking at the code I found that the WebsocketStream implements Sink for an underlying
Stream : AsyncRead + AsyncWrite
Is there an easy way to access the inner stream to call
write_vectored
? Thanks for your helpThe text was updated successfully, but these errors were encountered: