
JSON Compression by Rotating Data 90° - sfeather
http://malctheoracle.com/post/json-compression-by-rotating-data-90-degrees
======
malctheoracle
For those that assumed the compression was all about the pipe - here is the
follow-up.

[http://malctheoracle.com/post/json-compression-part-
deux](http://malctheoracle.com/post/json-compression-part-deux)

------
lothiraldan
So it's basically column oriented json? But 90d json is so much hipster...

------
Somojojojo
This looks a lot like the first compression step in JSON HPack:
[https://github.com/WebReflection/json.hpack/wiki](https://github.com/WebReflection/json.hpack/wiki)

------
deepsun
If you care about size, then the first step should be choosing the right
protocol for the task, e.g. Protobufs.

Changing your data structure for the sake of compression harms the main
advantage of JSON: convenience.

------
stephenr
If you're taking this approach, why not just text/csv as your data format. If
you already _know_ the field order/names you can even omit the header row
completely.

------
markauskas
I would recommend gzip compression instead of this, which would compress the
given data even more, without requiring any code changes.

~~~
Tiquor
Yeah, why go through all this?

~~~
Somojojojo
Well, at the end of the article he shows this technique used along with gzip.
He however does not show a comparison of the original vs his 90deg compression
with gzip; so the difference there may be negligible.

~~~
xellisx
"After GZip the original file was squeezed down to just 132 bytes, however
GZip took my technique down to just 99 bytes which saves a further 33 bytes."

When you want speed - every byte counts right?

