Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to faster compression library #38

Open
101arrowz opened this issue Dec 2, 2020 · 0 comments
Open

Switch to faster compression library #38

101arrowz opened this issue Dec 2, 2020 · 0 comments

Comments

@101arrowz
Copy link

101arrowz commented Dec 2, 2020

I've been working on a compression library fflate for the past few months. It performs quite a bit better than Pako in most circumstances for both compression and decompression of DEFLATE, implements GZIP and Zlib wrappers, and supports offloading processing to a separate Worker thread to avoid blocking. This should allow for much more similar functionality to the Node.js module.

Although the binary output for the compression methods is often vastly different from true Zlib with fflate, this shouldn't really matter, since the output is still valid and works fine. In some cases, the output is larger at the same level, but always by under 5%, and in exchange performance can increase by up to 50%. In addition, the API is completely different to that of Pako and Zlib, so this package may require a major rewrite.

Overall, browserify-zlib can weigh less, achieve higher performance, and, in some cases, act more similarly to true Node.js package (i.e. not blocking with the callback variant) using this implementation. If the maintainers are interested, I can submit a PR with the changes.

P.S. It may be of interest to update the package to use Pako 2.0 even if fflate won't work here.

/cc @browserify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant