I would recommend gzip compression instead of this, which would compress the given data even more, without requiring any code changes.
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.
When you want speed - every byte counts right?