Earlier quoted context omitted.
Glad I'm not the only one who reads it that way.
J cough?
JCOF: JSON-like Compact Object Format
11–20 of 69 posts
Re: JCOF: JSON-like Compact Object Format
#12Neither fully human-editable nor really compact, but an interesting experiment nonetheless.
Re: JCOF: JSON-like Compact Object Format
#13Re: JCOF: JSON-like Compact Object Format
#14People keep reinventing JSON trying to beat gzip, and it never beats the simplicity of gzipping JSON...
Re: JCOF: JSON-like Compact Object Format
#15Re: JCOF: JSON-like Compact Object Format
#16Earlier quoted context omitted.
Jack off, I'm afraid.
Interesting, I wonder which type of English speakers would see that as their initial hunch for pronunciation.
Re: JCOF: JSON-like Compact Object Format
#17Serialization formats that dedupe and perform other fancy processing trade increased CPU time for decreased memory usage. People who care about CPU time will want to measure the CPU time hit as well as the memory savings. This format is also not interoperable without a decoding library, which kind of invalidates the comparison to JSON. If you're going to do this, why not just go full binary and save even more memory?
Re: JCOF: JSON-like Compact Object Format
#18* JSON is really schemaless so I don't have to assume all objects are shaped the same or that they are even the same kind of object. This allows for streaming serialization, and does not require the data structure to be known or to introspect data to create the heading lines.
* Nested objects look to be difficult, especially if the schema is not known.
* JSON is very human friendly, JCOF is not.
I do think the format is better than CSV, TSV and other delimited flat record formats. JCOF appears to be able to handle objects that are not tabular, which CSV just can't really do. A replacement for JSON this is not, and storage efficiency isn't really relevant because of the difference in purpose.
Re: JCOF: JSON-like Compact Object Format
#19Earlier quoted context omitted.
curl https://raw.githubusercontent.com/mortie/jcof/main/tests/corpus/meteorites.json | gzip -9 | wc Gives me 34569 So the comparison is: JSON: 244920 bytes JCOF: 87028 bytes GZIP: 34569 bytes
To be fair you would gzip the JCOF encoding in this example too. Author mentions gzip doesn’t work for some use cases. For use case mentioned I’d expect sqlite to be similar, at least that is the default thing I’d reach for. If for some reason sqlite wasn’t sufficient probably a custom binary encoding controlled and updated via code instead of config would be next.
json jcof jcof/json
plain 244975 87083 0.355
gzip -6 35829 33152 0.925
gzip -9 34384 32875 0.956
xz -9 27864 28696 1.030
And I imagine this is close to ideal for jcof. So unless that last few % really matters, gzipped JSON is probably much better in the general case.Re: JCOF: JSON-like Compact Object Format
#20People keep reinventing JSON trying to beat gzip, and it never beats the simplicity of gzipping JSON...
JSON: 51949 bytes
JCOF: 37480 bytes (0.721x)
JSON ZIPED: 15178 bytes
Zipped json wins again.