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

optimized small key hashes by using bzhi instead of the switch construct #87

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

Conversation

octanico
Copy link

No description provided.

@sebres
Copy link

sebres commented Apr 23, 2021

Endianness?

One could surely do that, but have to check __BYTE_ORDER (__BIG_ENDIAN__, __LITTLE_ENDIAN__, etc) or use htonll and co.
Just... good luck to implement it cross platform and compiler - for instance some compilers may lack __BYTE_ORDER and friends as well as probably unable to optimize constructs like this at compile time:

int n = 1; if(*(char *)&n) { /* Little Endian */ } else { /* Big Endian */ } 

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