-
-
Notifications
You must be signed in to change notification settings - Fork 681
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
enable setting compression level #1378
Conversation
4328b96
to
834cd4d
Compare
src/store/writer.rs
Outdated
pub fn new(writer: WritePtr, compressor: Compressor, block_size: usize) -> StoreWriter { | ||
pub fn new( | ||
writer: WritePtr, | ||
compressor: Compressor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why isn't that part of the compressor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compressor is currently constructed by deserializing from the compressor name. To pass more parameters we would need much more complicated deserialization.
And there are cases where the Compressor is only used for decompression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why isn't compression part of the compressor?
If we have parameters that are compressor specific, it seems like an antipattern to have the union of these parameters in a list of options.
Codecov Report
@@ Coverage Diff @@
## main #1378 +/- ##
=======================================
Coverage 94.22% 94.23%
=======================================
Files 235 235
Lines 42893 42922 +29
=======================================
+ Hits 40418 40449 +31
+ Misses 2475 2473 -2
Continue to review full report at Codecov.
|
We have decompress only compressor
We could have |
@PSeitz Can you investigate if a refactoring to make that nicer? So the compressor The footer part is a bit lame, because the level is not necessary, but that's fine. |
0b1196f
to
bf461ba
Compare
use custom de/serializer for compressor accept parameters like zstd(compression_level=5) as compressor
pub fn compress( | ||
uncompressed: &[u8], | ||
compressed: &mut Vec<u8>, | ||
compression_level: Option<i32>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can it be negative?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for more speed
No description provided.