Skip to content

Commit

Permalink
Set zstd compression level to 1 as it offers fastest compression with…
Browse files Browse the repository at this point in the history
… small size tradeoff. (solana-labs#2729)

Get faster compression level --fast=4

As per https://github.com/facebook/zstd/tree/dev?tab=readme-ov-file#benchmarks
Level=4 offers faster compression 710MB/s vs. 670 MB/s
  • Loading branch information
ksolana authored Sep 9, 2024
1 parent 89050f3 commit c7e44c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion runtime/src/snapshot_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1083,8 +1083,9 @@ fn archive_snapshot(
encoder.finish().map_err(E::FinishEncoder)?;
}
ArchiveFormat::TarZstd => {
// Compression level of 1 is optimized for speed.
let mut encoder =
zstd::stream::Encoder::new(archive_file, 0).map_err(E::CreateEncoder)?;
zstd::stream::Encoder::new(archive_file, 1).map_err(E::CreateEncoder)?;
do_archive_files(&mut encoder)?;
encoder.finish().map_err(E::FinishEncoder)?;
}
Expand Down

0 comments on commit c7e44c1

Please sign in to comment.