3 ms·
Anyone know of a Javascript implementation of Snappy? There's a binding for Node, but not a Javascript implementation which would be useful in the browser consi
by jorangreef 15y ago
Anyone know of a Javascript implementation of Snappy? There's a binding for Node, but not a Javascript implementation which would be useful in the browser considering IndexedDB and Websockets support binary data.
- gmac 15y agoNo, 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.