3 ms·
On the server side what do you use? Is it custom code to essentially reimplement the usual RPC patterns and multiplexing, etc? Or are you using something like
by hardwaresofton 4y ago
On the server side what do you use? Is it custom code to essentially reimplement the usual RPC patterns and multiplexing, etc?
Or are you using something like trpc?[0]
Another thing I’ve also thought is that Content-Type plus the appropriate headers could easily open up using compressed/efficient binary serialization on the web as well and unlock even further gains.
One thing though is the issues with how websockets complicate scaling horizontally for simple request handling.
[0]: https://trpc.io/docs/subscriptions https://trpc.io/docs/subscriptions
- austin-cheney 4y agoOn the server I use WebSockets between peers. I use my own WebSocket implementation but I try to stay within RFC6455 even when not talking to browser just so that I have a uniform format processing. I can see how protobuf would be handy if you are just talking only to a database or directly transmitting a binary BLOB, but I rarely do any of that. Most of my messaging are microservices used by the application so I just use JSON.stringify for each message. I know there is overhead to that, but it works well for me. I should probably find a way to pull my application data directly into a binary format and back out without string handling, but I have not figured this out yet. Instead of 7x faster than HTTP my message handling would be 10-11x faster than HTTP.