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
Standard names for compression levels #89
Comments
Bonjour Christophe
Yes.
Well, I realized that having 2 separate functions, with zstd meaning the same as zstd_hc with a fixed level 1, did not helped API readability.
All levels <= 0 are simply remapped to 1 internally. for now.
Nope.
Yes. |
Do you mean this? https://github.com/facebook/folly/blob/master/folly/io/Compression.h#L152
It is currently a |
Good point. |
Within latest "dev" branch update d608088, there is a new method |
I have changed my code to query for
This gives Medium = 10 and Highest = 20 in the current version. Having 0 for the default level helps in that it is also the default value for uninitialized variables and optional parameters in .NET, which works well in the API. This could work if you NEVER use 0 as a compression level (even if you start using negative values). If not then I could simply use a nullable integer in the API, which would also be acceptable. If the minimum compression level can be less than 1 in the future, we would need a |
Agreed. This is the current convention, and is expected to remain like this.
Agreed, although this is just a "long term intention", with no precise plan. |
Is there anything else to add, or could we close the topic ? |
I think it's OK to close. To sum up:
|
I'm currently updating my wrapper for the new API introduced in 0.4.x, and I'm merging all the methods with and without compression levels into a single set of methods.
Asking the caller to pass an untyped integer value for the compression level seems a bit dangerous: most people will probably remember zlib, and expect a 1 - 9 scale with default at 5. That's why I would like to have an enum with well known names, and a clear default "if you don't know better use that one" level.
Quick questions:
The text was updated successfully, but these errors were encountered: