News for hackers. Stuff that matters.
Re:JSON Compression by Rotating Data 90° by malctheoracle on Thursday June 16, 2016 @07:08AM (#11915330)
For those that assumed the compression was all about the pipe - here is the follow-up.

http://malctheoracle.com/post/json-compression-part-deux

Re:JSON Compression by Rotating Data 90° by lothiraldan on Friday June 03, 2016 @03:01PM (#11832427)
So it's basically column oriented json? But 90d json is so much hipster...
Re:JSON Compression by Rotating Data 90° by Somojojojo on Friday June 03, 2016 @12:26PM (#11831266)
This looks a lot like the first compression step in JSON HPack: https://github.com/WebReflection/json.hpack/wiki
Re:JSON Compression by Rotating Data 90° by deepsun on Friday June 03, 2016 @07:01PM (#11833856)
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.

Re:JSON Compression by Rotating Data 90° by stephenr on Friday June 03, 2016 @11:43AM (#11830966)
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.
Re:JSON Compression by Rotating Data 90° by markauskas on Friday June 03, 2016 @11:50AM (#11831013)
I would recommend gzip compression instead of this, which would compress the given data even more, without requiring any code changes.
Re:JSON Compression by Rotating Data 90° by Somojojojo on Friday June 03, 2016 @05:14PM (#11833321)
While gzip compression is obviously better than this, which is more of an optimization, you can certainly pair this with gzip to get better results; albeit not much:

Sample JSON Object, using this technique:

>>> Length (Original): 25565

>>> Length (Original, gzip): 3966

>>> Length (Using 90deg): 15626

>>> Length (using 90deg, gzip): 3633

So while the optimization gives you almost 10k bytes in size reduction, the gzipped result is only a 300 byte reduction in this example.

Re:JSON Compression by Rotating Data 90° by Tiquor on Friday June 03, 2016 @01:00PM (#11831547)
Yeah, why go through all this?
Re:JSON Compression by Rotating Data 90° by Somojojojo on Friday June 03, 2016 @01:15PM (#11831638)
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.
Re:JSON Compression by Rotating Data 90° by xellisx on Saturday June 04, 2016 @07:39PM (#11838793)
"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?

Re:JSON Compression by Rotating Data 90° by tym0 on Saturday June 04, 2016 @02:47AM (#11835270)
He does say that the original file gzipped is 132 bytes, doesn't seem worth it to me.
Re:JSON Compression by Rotating Data 90° by larvyde on Monday June 06, 2016 @03:35AM (#11845212)
You end up basically returning a dump of an SQL query