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

[improve][LZ4] Optimize LZ4 compression algorithm implementation #261

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liangyepianzhou
Copy link

Motivation

We are looking for 4-byte repeating blocks, but are using 8 bytes for hashing. Although this reduces the probability of hash collisions, it also reduces the probability of finding suitable repeated code blocks, which leads to a decrease in compression rate.

Modification

Replace hash(UNSAFE.getLong(inputBase, input), mask) with hash(UNSAFE.getInt(inputBase, input), mask).

Verify

I will submit the test results later。

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.

1 participant