compress-json
compress-json copied to clipboard
Add lzwCompress.js and lz-string to the benchmarks
It would be nice to be able to compare your library to those: https://github.com/floydpink/lzwCompress.js https://github.com/pieroxy/lz-string
Would it be possible to add them to the benchmarks ? Thanks
Good suggestion, you can add tests (benchmark) for these library following the tests in https://github.com/beenotung/compress-json/blob/05665812cb98aba0a0044bdea16495f4e3d765c7/test/compress-test.ts#L88-L113
lz-string seems to be binary compression, may not be fair comparison (because the underline storage engine may need to escape binary string before storing them which can add the storage size significantly);
I do not have access to the original sample data at the moment. Just did a trial with lzwcompress on another 50k sample data from the same online forum dataset.
Number of sample object: 50,000
- | JSON | compressed-json | compress-json | lzwcompress |
---|---|---|---|---|
Compressed Size | 45M | 36M | 34M | 42M |
Compress Time | 197ms | 1.6s | 2.6s | 6.3s |
Decompress Time | 274ms | 569ms | 1.6s | 560ms |
Exact Match* | Yes | No | Yes | No |
Remark: exact match consider whevether the order of object key is preserved when decompressed from the compressed representation.
In fact, the one I was the most interested in is lz-string. I'll look into it, thank you very much!