Skip to content
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

Compression level zero is very slow #156

Open
fintelia opened this issue Sep 21, 2024 · 0 comments
Open

Compression level zero is very slow #156

fintelia opened this issue Sep 21, 2024 · 0 comments
Assignees

Comments

@fintelia
Copy link

When set to not apply compression, writing compressed output should mostly just amount to memcpy'ing the input data to the output. However, actual performance seem to be on the order of 120 MB/s. Some quick profiling indicates that a substantial amount of time is spent updating hash chains and recording literals. Neither of these operations should be necessary to produce uncompressed output.

Benchmarking via flate2:

let mut encoder = flate2::write::ZlibEncoder::new(Vec::new(), flate2::Compression::new(0));
encoder.write_all(&bytes).unwrap();
encoder.flush_finish().unwrap();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants