Show HN: Homogenius – Packer/unpacker to reduce the size of JSON
homogenius.github.io
homogenius.github.io
Edit: I did a quick test by myself, using the first example but repeated for 10,000 objects:
Raw: 550111
Homogenius: 150183
Raw gzipped: 1688
Homogenius gzipped: 419
Interesting to see a ~4x between raw JSON and Homogenius JSON both when compressed and not compressed. gzip+Homogenius < gzip < Homogenius < original JSON
gzip+Homogenius will typically be better than just gzip because Homogenius 'knows' about the structure of JSON. gzip will typically be better than Homogenius (without gzip) because it can compress the payload.Here's the size (in bytes) of the sample files given with the project:
69934 packed-homogenius.json.gz
79550 verbose.json.gz
213742 packed-homogenius.json
265177 verbose.jsonInteresting to see a similar correlation in your results in the ratio between the two non-gzipped and gzipped files.
52093 verbose.json.bz2
56298 packed-homogenius.json.bz2
68521 packed-homogenius.json.gz
79222 verbose.json.gz
213742 packed-homogenius.json
265177 verbose.jsonSee http://mattmahoney.net/dc/dce.html#Section_55 for more discussion
1) Fix bandwidth problems caused by API designer laziness.
2) Detect API designer laziness and programmer laziness.
The API designer laziness merits description. Essentially, if you as an API host server are sending back tons of redundant data, you are doing a disservice to your user by not passing references to this data in the first place. The results in your API should either include an entities section or links to retrieve more data. (Note the scale of repeated data I am talking about here are subtrees, not just key/value)
The programmer laziness is when an he just sends back JSON.stringify(someVeryLargeObject), instead of making sure only a minimal object is sent back.
So we can detect this laziness by running this tool and looking for 4x compression gains!
thks to make it and i will use it (in go i think).