3 ms·
Just to add another dimension to your analysis, if you're sending large binaries the 33% overhead of Base64 adds up pretty quickly. It may not apply to your use
by dmm 8y ago
Just to add another dimension to your analysis, if you're sending large binaries the 33% overhead of Base64 adds up pretty quickly. It may not apply to your use case but if you are delivering images or video over a websocket it can make a big difference.
- dchest 8y agoOn the other hand, gzip can reclaim most of those 33% with Huffman encoding.
- dmm 8y agoThat's something I hadn't considered. I'll have to do some benchmarking. Thanks!
- Const-me 8y agoOnly in some cases. Also it increases latency. Here’s my old article about Microsoft’s binary XML format: http://const.me/articles/net-tcp/ http://const.me/articles/net-tcp/ As you see, for some payloads it compresses XML to 9% of the original size. The data contract serializer included in .NET framework (and even in .NET Core) can read & write objects directly from/to this binary serialization format, without intermediate text XML anywhere.