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

Use lookup tables safely #36

Merged
merged 2 commits into from
Jun 29, 2019
Merged

Use lookup tables safely #36

merged 2 commits into from
Jun 29, 2019

Conversation

Shnatsel
Copy link
Contributor

Use regular indexing operations for lookup tables instead of get_unchecked(). This regresses performance by 0.7% - decoding enwiki-latest-all-titles-in-ns0.gz goes from 2,160s to 2,175s on my machine, as measured with hyperfine:
hyperfine -m 25 --warmup=3 'target/release/examples/flate -i enwiki-latest-all-titles-in-ns0.gz -o /dev/null gzip-decode'

Since the main selling point of a Rust implementation is safety, I don't think using unsafe for less than 1% speedup is justified.

@codecov-io
Copy link

codecov-io commented Jun 26, 2019

Codecov Report

Merging #36 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #36   +/-   ##
=======================================
  Coverage   91.46%   91.46%           
=======================================
  Files          14       14           
  Lines        1301     1301           
=======================================
  Hits         1190     1190           
  Misses        111      111
Impacted Files Coverage Δ
src/deflate/symbol.rs 93.06% <100%> (ø) ⬆️
src/lz77/default.rs 89.1% <100%> (ø) ⬆️
src/huffman.rs 94.02% <100%> (ø) ⬆️

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 cbf1289...659ffd8. Read the comment docs.

Copy link
Owner

@sile sile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@sile sile merged commit a2971a4 into sile:master Jun 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants