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

perf(core/bit_utils.h): optimize MostSignificantBit default impl #1064

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

servusdei2018
Copy link

The fallback implementation for MostSignificantBit was optimized, replacing the while loop with a series of bitwise operations. Tests on my system indicate a 3-4x speedup.

@servusdei2018
Copy link
Author

And here's a reference benchmark comparing the original and modified implementations: https://godbolt.org/z/fE8vvfcv9

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