101arrowz / fzstd

High performance Zstandard decompression in a pure JavaScript, 8kB package
MIT License
218 stars 11 forks source link

Question: Are there plans to have this library do compression and decompression using Zstandard/zstd? #3

Closed jdrews closed 3 years ago

jdrews commented 3 years ago

I noticed this library focuses entirely on decompression while fflate does compression and decompression. Are there plans to enable compression in the future for this library? Thanks!

101arrowz commented 3 years ago

This project was more of an experiment than fflate, and I don't really have as thorough an understanding of the Zstandard architecture (especially finite state entropy compression) as I do of DEFLATE. I'm planning to do some more reading on FSE to see if I can implement it effectively.

There's still another concern if I do learn how FSE works. Right now fzstd has a real use case for situations where there's only a couple kB to MB of data (i.e. too little for WASM to have a big advantage) or there's a massive amount of data (where the easier data streaming features of fzstd make it much more appealing). However, when it comes to compression, I don't know if fzstd will be even nearly as fast as a WASM port, let alone as effective at compression. It would take a lot more optimization than it's worth to even come close to someone who runs two emscripten commands.

For now I don't have any plans to implement a good compressor but I'll try to make a working compressor at some point, depending on how difficult FSE is.

jdrews commented 3 years ago

Thanks for the vision on the repo!