-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Remove cgo zstd package #1477
Remove cgo zstd package #1477
Conversation
Switch from cgo package to pure Go implementation. This will (when fixed) work even if no cgo is present. https://github.com/klauspost/compress/tree/master/zstd#zstd Compression level is removed. It could be made so the first request determines the compression level. But since there is currently only two levels (fast and default) I am not sure it is worth it. This does NOT fix IBM#1252 - only updates the code used for compression/decompression.
CLA signed... |
Good timing, I just started to experiment with your lib yesterday to do exactly what this PR does. Thank you so much 👍 |
@bai might want to include your change to the build files, to disable explicitly cgo |
We are running into issues with the new dependencies in influxdata/telegraf#6344 and this would solve that issue. I notice there is a relatively large init function though: https://github.com/klauspost/compress/blob/master/zstd/fse_predefined.go#L72 If this could be ran on first use or manually that would be ideal for us, since a very low number of Telegraf users would use this functionality but everyone would need to run the init code on startup. I recognize this is mostly an issue with Telegraf but if these compression methods could be optional that would be very helpful for us. |
looks like a valid failure. |
@varun06 Yeah, I guess it wants zero byte encoding to be have the complete wrapping. This just returns a 0 byte slice. I will add an option to the encoder. Added PR: klauspost/compress#155 That said, expecting specific encoding in compression is perhaps a bit iffy. I will update it to the new values. @danielnelson Actually not an unreasonable thing 👍 I will take a look. PR: klauspost/compress#156 |
Looks like the only thing that prevents this PR from being 🍏 is this newline that makes Do you think you could remote that extra newline or cherry-pick my commit so we could get this merged? 🙏 |
@bai Sorry. I had forgot to set up go fmt. Fixed now. |
Fantastic, thank you! |
Switch from cgo package to pure Go implementation. This will (when fixed) work even if no cgo is present.
https://github.com/klauspost/compress/tree/master/zstd#zstd
Compression level is removed. It could be made so the first request determines the compression level. But since there is currently only two levels (fast and default) I am not sure it is worth it.
This does NOT fix #1252 - only updates the code used for compression/decompression.