-
Notifications
You must be signed in to change notification settings - Fork 181
Use partial flushes with miniz_oxide backend #496
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
Conversation
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.
Thanks a lot for looking into this!
I think it's best to validate this change, which to my mind should be good.
@@ -136,7 +136,8 @@ impl From<FlushCompress> for MZFlush { | |||
fn from(value: FlushCompress) -> Self { | |||
match value { | |||
FlushCompress::None => Self::None, | |||
FlushCompress::Partial | FlushCompress::Sync => Self::Sync, | |||
FlushCompress::Partial => Self::Partial, |
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.
@oyvindln Do you know if there was a reason not to use partial flushes before? If not, then it's probably safe to map it 1:1, but I wanted to check with you.
Thanks for your help!
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.
I have no idea - would have to look into it
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.
I looked into it by digging through the history, and it's unclear why things are the way they are.
There was a time when there was direct conversion.
flush: FlushCompress,
) -> Result<Status, CompressError> {
let flush = MZFlush::new(flush as i32).unwrap();
The revision that actually introduced this line didn't mention why either.
So I think it's fair to merge this.
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.
After double-checking, I don't think we can find out why not to do it, without any indication of why that is in the Git history.
Hey, this was done in #462, I mapped it this way because of the MZFlush::new i32 constructor ( FlushCompress::Partial is |
Yes, I discovered after this PR that (Someone should also probably make a PR to update the |
I'll admit that I don't quite know why the code previously mapped
FlushCompress::Partial
to a sync flush