3 ms·
The choice of JSON is strange. The messages aren’t human readable, and message size may be limited (e.g. SMS). Using a compact binary wire format like protobuf
by oefrha 3y ago
The choice of JSON is strange. The messages aren’t human readable, and message size may be limited (e.g. SMS). Using a compact binary wire format like protobuf could save ~20 bytes per message.
Edit: binary format is of course base64 or more compactly encoded to text in the end.
- f_devd 3y agoI would assume it's for compatibility, things like null-bytes aren't generally valid inputs by messaging apps, they could have done base91 or something unicode-based with msgpack/protobuf though
- oefrha 3y agoHopefully it’s obvious I was talking about base64-encoded (or more compact) binary messages…
- deleted 3y ago[deleted]
- janosdebugs 3y agoBase64 adds ~30% in length to the message. Not sure it's worth it.
- Izkata 3y ago> and message size may be limited (e.g. SMS) There's long been a transparent in-the-background upgrade to MMS when the message gets too big, so this shouldn't be a problem.