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

Performance improvement #4

Merged
merged 2 commits into from
Aug 22, 2019
Merged

Performance improvement #4

merged 2 commits into from
Aug 22, 2019

Conversation

israellot
Copy link
Contributor

This small change reverses the origin loop order. By doing so landmarks become the first appearance of each hash, and collides are on forward ( left to right ) order.
This greatly improves performance, especially for larger inputs with small changes.
The original code, when matching a huge section would find the landmark, which would be further to the right, and cycle the collisions from left to right, getting a bigger match at every pass. With this modification most times the code can find the biggest match at the first pass, and skip checking if the other collisions are inside the already found match.

@endel
Copy link
Owner

endel commented Jun 27, 2019

Hi @israellot, thanks a lot for this pull-request! Sounds like you really dived deep on this!

I haven't been using this library lately though, can you confirm if the tests are still passing? Cheers!

@israellot
Copy link
Contributor Author

Yes, the tests are still fine.
Thanks for the work you've done years ago, it has been useful for me on a data sync project.

@endel endel merged commit c52680c into endel:master Aug 22, 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.

None yet

2 participants