-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Once Teddy finds a fingerprint, it needs to check if there is really a match. The old approach was to iterate over the set bits of both 64-bit halves of the fingerprint-checking vector. The new approach first extracts a bitfield that tells which bytes of the fingerprint-checking vector are non-zero. Then it iterates over those bytes. This seems to be faster (up to about 10% in some benchmarks). It seems like the main reason that this approach is faster is that most matched fingerprints only match in one place. The new code narrows in on the important place more quickly, whereas the old code wasted time unnecessarily examining an empty u64. The gain seems to be larger with AVX2 support (which is not included in this patch). Presumably it would be even larger with AVX512.
- Loading branch information
1 parent
0be0b4c
commit 56584ad
Showing
1 changed file
with
37 additions
and
56 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