-
Notifications
You must be signed in to change notification settings - Fork 41
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
[feature request] Support for zstd compression #85
Comments
Hello there, and thank you for your issue! We are currently using pgzip (parallel gzip compression) by @klauspost, which also is the author of I'm not entirely sure if I am reading the results correctly, so please let me know if I didn't. If you find any alternative zstd libraries which are provably faster I'm happy to implement using them as an option! PS: How fun with another Swede, and with your impressive application Rymdport, it's basically the same name as Portal in Swedish! |
Another factor to consider is decompression speed. In that department zstd is significantly better than any gzip/deflate based. But yeah, zstd is missing a "multithreaded" compression mode. Not sure when I get the time for that. |
@klauspost Thanks. That explains things. Which version of |
@Jacalz It is updated about a week ago. So current.
Decompression speeds:
gzip decompression is a bottleneck. For local network transfer I would personally go for S2. It is made for speed both when compressing and decompressing. But if the expected network speed is below 3 gigabits/s zstd would make more sense. |
Thanks for the explanation and clear benchmark results. S2 sounds like a great option then. |
Thank you for your input Klaus! S2 does look like a good overall option indeed. Furthermore, I have noticed that gzip spends a lot of time doing nothing with incompressible/already compressed files, and I read that S2 is great for that usecase. The best way forward is probably to add an option/flag of using several of these compression algorithms, S2 included, and possibly changing the default in the next major version of Portal. That would require communicating the algorithm used and supported for the sender, and the supported algorithms by the peer. |
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Gzip is relatively slow and doesn't compress that well. Zstd seems to be a more modern implementation with great performance and compression levels.
I've wanted to add that to magic-wormhole but the process of getting it standardised is a bit more cumbersome.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Implementing Zstd compression using https://pkg.go.dev/github.com/klauspost/compress/zstd.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Are there any other algorithms that are faster and compress better? I doubt it but it is always worth it to benchmark and compare :)
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: