4 ms·
I too like JSON, however it is somewhat inefficient for arrays, where you end up repeating keys a lot. If you're gzipping, it probably doesn't matter as much...
by osrec 8y ago
I too like JSON, however it is somewhat inefficient for arrays, where you end up repeating keys a lot. If you're gzipping, it probably doesn't matter as much...
- tim333 8y agoI'm slightly puzzled. Array = [[1,2,3],[4,5,6]] seems valid json and I'm not sure what's inefficient or where the keys come in?
- zinckiwi 8y agos/arrays/"collections of homogenous objects" and it's a fair point.
- osrec 8y agoI was thinking of arrays of objects, where the keys are repeated for each object in the array.
- Secretmapper 8y agoI'm still a bit confused how this is a problem. Can you elaborate? Is there any serialisation standard that specifically addresses this? I know YAML and TOML doesn't at least (correct me if I"m wrong)
- SigmundA 8y agoSomething like Protobuf where there is a schema is defined means metadata like key name does not get repeated for every object, its only the values. No more trying to have short names to keep file size down.
- egeozcan 8y agoIMHO, it sounds like the job of the compression algorithm, not the format.
- imtringued 8y agoThen use compression. gzipped json is highly efficient over the wire. https://blog.octo.com/en/protocol-buffers-benchmark-and-mobile/ https://blog.octo.com/en/protocol-buffers-benchmark-and-mobi... The primary purpose of binary data formats is that they can be parsed quickly and some even allow direct access without a parsing step.
- osrec 8y agoThat's what I said in my first comment, no?