4 ms·
No, but I've been using an LZMA library [1] to compress data sent over binary WebSockets. LZMA is nice for streaming data to many clients (i.e. compress once,
by gmac 15y ago
No, but I've been using an LZMA library [1] to compress data sent over binary WebSockets.
LZMA is nice for streaming data to many clients (i.e. compress once, decompress many times), because although compression time/CPU is high (LZMA > BZIP2 > GZIP), compression ratio is very good (LZMA > BZIP2 > GZIP) and decompression not too bad (BZIP2 > LZMA > GZIP) [2].
[1] http://code.google.com/p/js-lzma/ http://code.google.com/p/js-lzma/
[2] Disclaimer: I should check, but haven't yet, whether these inequalities hold for this JS LZMA implementation relative to the available GZIP and BZIP2 ones.
- jorangreef 15y agoThank you, I spotted BZIP2 and LZMA. Looking for compression/decompression cpu cost of X < GZIP < BZIP2 < LZMA where compression ratio is of secondary concern.