I discovered JSON Binpack recently, which works either schemaless (like msgpack) or - supposedly more efficiently - with a schema. I haven't tried the codebase yet but it looks interesting.
8 comments
I discovered JSON Binpack recently, which works either schemaless (like msgpack) or - supposedly more efficiently - with a schema. I haven't tried the codebase yet but it looks interesting.
Shouts to msgspec - i havent had a project without it in awhile.
Ignorant question - is the relatively small size benefit worth another standard that's fairly opaque to troubleshooting and loses readability?
Is there a direct comparison of why someone should choose this over alternatives? 27 bytes down to 18 bytes (for their example) just doesn't seem like enough of a benefit. This clearly isn't targeted to me in either case, but for someone without much knowledge of the space, it seems like a solution in search of a problem.
I'd argue the value goes up with larger payloads. The tradeoff is ease of use vs efficiency.
If you need a format that can transport byte arrays unmodified (image data, etc), msgpack (or protos or whatever) is much better than JSON since you don't have to base64 encode or escape the data. It also supports non-string keys which can be convenient.
I’m not sure why you wouldn’t just develop in json, then flick a switch to use binary.
We already have CBOR and other binary JSONs.
I've built a few systems using msgpack-rpc - serves really well as a transport format in my experience!