Re:MessagePack: like JSON, but fast and small
by giantrobot on Wednesday March 11, 2020 @07:10PM
(#22551798)
So you're saying MessagePack with no compression is way smaller than JSON. Which means with no load for compression it has a 40% bandwidth savings. With compression it's negligibly worse than compressed JSON. Seems like a back foot argument for MessagePack over JSON. That's to say nothing of the encode/decode efficiency differences.
In the case where your data can't be cached but CloudFlare proxies and compresses for you, MessagePack wins because your uncompressed connection to CF is 40% more bandwidth efficient so egress out of your app server for any traffic is reduced. In the case where CF can cache responses you get the same back end bandwidth win for a negligible (if any actual) amount of extra egress out of CF.
Use what you want but if you need a schemaless serialization format, MessagePack works well and is compact for "free".
I just took a quick look and they do compress their queries, using Brotli, which is even more efficient than GZIP. They are behind Cloudflare, so it's probably from them.
I just tried with https://jsonplaceholder.typicode.com/todos and I get this:
Raw:
JSON: 24,311
MessagePack: 14,704
60 %
With GZIP:
JSON: 3,965
MessagePack: 4,063
102%
With Brotli:
JSON: 3,495
MessagePack: 3,704
106%
So essentially, MessagePack compressed is WORSE than JSON, and not compressed, is at least 3 times worse than compressed.