MessagePack: It's like JSON, but fast and small.

msgpack.org

19 points

davikr

4 hours ago


8 comments

karteum 14 minutes ago

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.

https://jsonbinpack.sourcemeta.com/

slurpyb 38 minutes ago

Shouts to msgspec - i havent had a project without it in awhile.

vdqtp3 23 minutes ago

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.

  • div3rs3 9 minutes ago

    I'd argue the value goes up with larger payloads. The tradeoff is ease of use vs efficiency.

  • willhbr 12 minutes ago

    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.

  • 2muchcoffeeman 13 minutes ago

    I’m not sure why you wouldn’t just develop in json, then flick a switch to use binary.

  • cryptonector 13 minutes ago

    We already have CBOR and other binary JSONs.

mattbillenstein 4 hours ago

I've built a few systems using msgpack-rpc - serves really well as a transport format in my experience!