Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

JSON compresses well in general. Can you do the same with a binary version?


I only have the "final" 13.5kb version to test against. It compresses very well:

  gzip:     6.95kb    (98.9%)
  brotli:   5.99kb    (99.0%)


Man, I should have done this — would've been a much nicer number for the headline. Thanks for the analysis, though, this is really cool!


I compared it to image in PNG and QOI formats [0]

    img:         13.552kb (100%)
    img.png:      1.877kb (13.8%)
    img.qoi:     10.316kb (76.1%)
    img.qoi.gz:   1.167kb (8.6%)
While it does compress by 50%, it's not a format optimized for compression unlike png or qoi

[0]: https://qoiformat.org/


Given equivalent data stored in both JSON and BSON format I would expect them both to compress down to blobs of roughly equivalent sizes. This is because both encode roughly the same amount of information, so the compression algorithm will tend to compress down to the same final result. I haven't run this as an experiment though..that would be fun.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: