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

Replace XXH64 with a simplified version #346

Merged
merged 1 commit into from
Sep 26, 2023
Merged

Replace XXH64 with a simplified version #346

merged 1 commit into from
Sep 26, 2023

Conversation

marcelm
Copy link
Collaborator

@marcelm marcelm commented Sep 21, 2023

This function gives the same result as regular XXH64(), but with the difference that it only works on single 64-bit values, which makes it possible to reduce it to just a couple of lines; mostly the "bit mixing" part (functions finalize()/avalanche()) is left.

This performs a little bit better than calling the original function on an 8-byte slice because the compiler (at least GCC) does not fully inline the original function (finalize() remains a function call).

This speeds up index generation by a couple of percent: 163 are reduced to 159 seconds for CHM13.

This function gives the same result as regular xxh64(), but the difference
is that it only works on single 64-bit values.

Mostly the "bit mixing" part of xxh64 (functions finalize()/avalanche()) is
left.

This performs a little bit better than calling the original function on an
8-byte slice because the compiler does not fully inline everything
(finalize() remains a function call).

This speeds up index generation by a couple of percent.
@ksahlin
Copy link
Owner

ksahlin commented Sep 21, 2023

Approved.

@marcelm marcelm merged commit e30fed4 into main Sep 26, 2023
9 checks passed
@marcelm marcelm deleted the mini-xxh64 branch September 26, 2023 12:51
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