top | item 37920255

(no title)

tumultco | 2 years ago

I was curious about this myself. I extracted the json for the "uncompressed" image:

https://gist.github.com/jmfd/8dbb96fcd8a1ba1e8ad6e9167bd70ce...

And then tried these commands against it:

  gzip:        39.56kb    (93.7%)
  zstd:        35.86kb    (94.3%)
  gzip -9:     35.51kb    (94.4%)
  bzip2:       24.35kb    (96.1%)
  zstd -19:    24.01kb    (96.2%)
  brotli:      21.42kb    (96.6%)
(I'm not up-to-date on default web server configs, but I imagine most would automatically transmit with gzip over the wire for json?)

discuss

order

jagged-chisel|2 years ago

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

tumultco|2 years ago

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%)

mattarm|2 years ago

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.

jryan49|2 years ago

Is it faster though?