Skip to content

Commit

Permalink
Merge pull request #554 from lschuermann/dev/serialize-to-writer-buff…
Browse files Browse the repository at this point in the history
…ered

dumps/serialize_to_writer: insert BufWriter to speed up serialization
  • Loading branch information
Enselic authored Oct 21, 2024
2 parents 8f31002 + 38d0b0c commit 31bce65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dumps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fn serialize_to_writer_impl<T: Serialize, W: Write>(
use_compression: bool,
) -> Result<()> {
if use_compression {
let mut encoder = ZlibEncoder::new(output, Compression::best());
let mut encoder = std::io::BufWriter::new(ZlibEncoder::new(output, Compression::best()));
serialize_into(&mut encoder, to_dump)
} else {
serialize_into(output, to_dump)
Expand Down

0 comments on commit 31bce65

Please sign in to comment.