forked from Dav1dde/glad
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement fast linear search for matching hashes
I was surprised to see how this linear search can be vectorized by clang since it doesn't have any early termination conditions. It might well be more optimal than a binary search for small ranges simply because there's no branch misprediction or cache thrashing. To take advantage of this algorithm, we cut the search space using binary search until it's <= 256 elements, and then do the rest as a clang-vectorized linear search to avoid the heavy branch misprediction cost for the last several iterations. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
- Loading branch information
Showing
5 changed files
with
37 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters