3 ms·
I liked this CBOR vs MsgPack article from a while back (which also talks about size on the wire, not just performance): https://diziet.dreamwidth.org/6568.html
by dochtman 6y ago
I liked this CBOR vs MsgPack article from a while back (which also talks about size on the wire, not just performance):
https://diziet.dreamwidth.org/6568.html https://diziet.dreamwidth.org/6568.html
SBE (Simple Binary Encoding) also makes some interesting performance claims.
My pet peeve with both protobuf and capnp is the lack of an option type; they seem to be designed for languages with type systems that include null, rather than more modern languages like Rust or Kotlin.
- FullyFunctional 6y agoAnother vote for CBOR. I had actually designed my own binary JSON encoding out of frustration with BSON (which nobody should use IMO). My format was focused on compactness, but I dropped it when I found CBOR which was very similar and even slightly better in places. One notably thing about CBOR is the support for both Indefinite and Definite-Length Arrays and Maps (typically streaming generators need the former whereas parsing the latter can be more efficient).
- stinos 6y agoInterestng read, didn't know most of this. Not that it matters in the end: at one point we just needed something simple which would just work and MessagePack does just that :) Btw JSON is often a popular choice, but although this is not explicitly mentioned in the main article as a con which is an oversight imo, the actual JSON standard does not support NaN/+-Inf for floating point. That's insane, which is why most implementations have an option to allow that anyway, but not all, which can be quite the showstopper.
- heavenlyblue 6y agoProtobuf has fields that may not be required (although it is advised not to use it). How is that different from Option?