4 ms·
If you compress the json first, it isn't quite so bad. Example #1 (short string): input: 103 bytes gzip(input): 87 bytes base64(gzip(input)): 117 bytes
by stock_toaster 7y ago
If you compress the json first, it isn't quite so bad.
Example #1 (short string):
input: 103 bytes
gzip(input): 87 bytes
base64(gzip(input)): 117 bytes
Example #2 (long string):
input: 3122 bytes
gzip(input): 840 bytes
base64(gzip(input)): 1121 bytes
- KilledByAPixel 7y agoThanks, that is good reference. It makes sense that Zip would beat out JSON for longer strings. Just as another point of comparison, how about encodeURIComponent(gzip(input))?