by rikrassen · 11y ago · 0 comments
1. Dictionary keys are repeated when you have an array of similar objects.
2. Non-text data. JSON can't natively represent binary data, forcing people to use things like base64 for binary and base10 for numbers.It transmits type and field names. Depending on how complex your data is those strings could be a large part of the data.
{ "person": { "age": 30, "shoesize": 10 } }
The above is what, 4-5 bytes of protobuf? I'm not sure what the gzipped-json data is but likely a lot more. If you were to send a list of 100 such person objects, the difference would be smaller.
Assuming the integer fields are regular varint types (and not the "fixed" integer encoding), and assuming the tag numbers were all under 16, then this would be a six-byte protobuf.
No, it isn't true, but regardless of what format you use, there will always be someone who's not happy. Actually, I think that applies to everything in life.