4 ms·
I would recommend gzip compression instead of this, which would compress the given data even more, without requiring any code changes.
by markauskas 10y ago
I would recommend gzip compression instead of this, which would compress the given data even more, without requiring any code changes.
- Tiquor 10y agoYeah, why go through all this?
- Somojojojo 10y agoWell, 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.
- tym0 10y agoHe does say that the original file gzipped is 132 bytes, doesn't seem worth it to me.
- xellisx 10y ago"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?
- larvyde 10y agoYou end up basically returning a dump of an SQL query
- Somojojojo 10y agoWhile 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.