3 ms·
Ah shoot, poem's websocket implementation uses tokio_tungstenite like most of the other hyper-adjacent Rust web frameworks. It's unfortunate that library has be
by electromech 4y ago
Ah shoot, poem's websocket implementation uses tokio_tungstenite like most of the other hyper-adjacent Rust web frameworks. It's unfortunate that library has become the default for websockets because the performance is rather lacking. (new allocations for each incoming message IIRC)
- paulgb 4y agoIs there a good alternative in the tokio world currently? Actix-web does WebSockets but it expects to run on an actix executor AFAIK.
- electromech 4y agosoketto has a hyper example. I haven't found a websocket benchmark that compares them, but you can see here that soketto let's you re-use a buffer: https://docs.rs/soketto/latest/src/soketto/connection.rs.html#335 https://docs.rs/soketto/latest/src/soketto/connection.rs.htm... It's on my to-do list to try soketto, but the thought of benchmarking websocket implementations sounds tedious.
- nextaccountic 4y agoWhat's your preferred websocket implementation?
- electromech 4y ago(copy-pasting what I said in sibling comment) soketto has a hyper example. I haven't found a websocket benchmark that compares them, but you can see here that soketto let's you re-use a buffer: https://docs.rs/soketto/latest/src/soketto/connection.rs.html#335 https://docs.rs/soketto/latest/src/soketto/connection.rs.htm... It's on my to-do list to try soketto, but the thought of benchmarking websocket implementations sounds tedious.