Remix.run Logo
austin-cheney 2 days ago

I have a home grown websocket library I wrote in TypeScript for node.js. When I measured it a couple of years ago here were my findings:

* I was able to send a little under 11x faster than I could process the messages on the receiving end. I suspected this was due to accounting for processing of frame headers with consideration of the various forms of message fragmentation. I also ran both send and receive operations on the same machine which could have biased the numbers

* I was able to send messages on my hardware at 280,000 messages per second. Bun claimed, at that time, a send rate of about 780,000 messages per second. My hardware is old with DDR3 memory. I suspect faster memory would increase those numbers more than anything else, but I never validated that

* In real world practical use switching from HTTP for data messaging to WebSockets made my big application about 8x faster overall in test automation.

Things I suspect, my other assumptions:

* A WebSocket library can achieve superior performance if written in a strongly typed language that is statically compiled and without garbage collection. Bun achieved far superior numbers and is written in Zig.

* I suspect that faster memory would lower the performance gap between sending and receiving when perf testing on a single machine