sile / libflate

A Rust implementation of DEFLATE algorithm and related formats (ZLIB, GZIP)
https://docs.rs/libflate
MIT License
178 stars 35 forks source link

Drop unsafe code from truncate_old_buffer() #32

Closed Shnatsel closed 5 years ago

Shnatsel commented 5 years ago

This has no measurable performance difference. flate-bench was too noisy, so I've used hyperfine to measure it:

hyperfine --min-runs=25 --warmup=3 'target/release/examples/flate -i enwiki-latest-all-titles-in-ns0.gz -o /dev/null gzip-decode'

This also does not regress rustc version compatibility because ptr::add has been added in 1.26 while slice::split_at_mut has been around since 1.0 and slice::copy_from_slice since 1.9

codecov-io commented 5 years ago

Codecov Report

Merging #32 into master will increase coverage by 0.03%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
+ Coverage   91.42%   91.46%   +0.03%     
==========================================
  Files          14       14              
  Lines        1295     1301       +6     
==========================================
+ Hits         1184     1190       +6     
  Misses        111      111
Impacted Files Coverage Δ
src/non_blocking/deflate/decode.rs 86.85% <0%> (+0.07%) :arrow_up:
src/deflate/encode.rs 96.62% <0%> (+0.02%) :arrow_up:
src/deflate/symbol.rs 93.06% <0%> (+0.02%) :arrow_up:
src/huffman.rs 94.02% <0%> (+0.09%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0f565d3...b468c0e. Read the comment docs.