Shnatsel commented on code in PR #169:
URL: https://github.com/apache/avro-rs/pull/169#discussion_r2022160386


##########
avro/src/codec.rs:
##########
@@ -61,13 +61,8 @@ impl Codec {
         match self {
             Codec::Null => (),
             Codec::Deflate => {
-                let mut encoder = Encoder::new(Vec::new());
-                encoder.write_all(stream).map_err(Error::DeflateCompress)?;
-                // Deflate errors seem to just be io::Error
-                *stream = encoder
-                    .finish()
-                    .into_result()
-                    .map_err(Error::DeflateCompressFinish)?;
+                let compressed = miniz_oxide::deflate::compress_to_vec(stream, 
6);

Review Comment:
   Yes, that is the compression level. Making it configurable is a good idea.
   
   I kept the API the same in this PR to get the performance improvements to 
users without requiring them to change any code. Adding this configuration 
would be a good follow-up.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to