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

Faster HC #471

Merged
merged 3 commits into from
Feb 21, 2018
Merged

Faster HC #471

merged 3 commits into from
Feb 21, 2018

Conversation

Cyan4973
Copy link
Member

These little changes speed up a bit Hash Chain match finder.

On my laptop, using clang:
before :

 3#silesia.tar       : 211984896 ->  81347969 (2.606),  71.8 MB/s ,2356.7 MB/s
 9#silesia.tar       : 211984896 ->  77890594 (2.722),  24.4 MB/s ,2420.0 MB/s

after :

 3#silesia.tar       : 211984896 ->  81347969 (2.606),  74.4 MB/s ,2351.9 MB/s
 9#silesia.tar       : 211984896 ->  77890594 (2.722),  25.4 MB/s ,2371.1 MB/s

by removing bad candidates faster.
by optimizing countback
Copy link
Contributor

@terrelln terrelln left a comment

Choose a reason for hiding this comment

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

Sorry it took so long, I missed this PR.

lib/lz4hc.c Outdated
@@ -220,20 +222,10 @@ LZ4_FORCE_INLINE int LZ4HC_InsertAndGetWiderMatch (
nbAttempts--;
if (matchIndex >= dictLimit) {
const BYTE* const matchPtr = base + matchIndex;
if (*(iLowLimit + longest) == *(matchPtr - delta + longest)) {
if (LZ4_read16(iLowLimit + longest - 1) == LZ4_read16(matchPtr - delta + longest - 1)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add an assert(longest >= 1);?

@Cyan4973 Cyan4973 merged commit 71e16fa into dev Feb 21, 2018
@Cyan4973 Cyan4973 deleted the fasterHC branch April 24, 2018 23:59
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.

2 participants