4 ms·
I've used popcnt in prod in last 10 years. We were looking for similar images in large sets, using a perceptual hash (64 bits, at least 60 bits being same consi
by scosman 3y ago
I've used popcnt in prod in last 10 years. We were looking for similar images in large sets, using a perceptual hash (64 bits, at least 60 bits being same considered a match).
Tried a few different solutions. Fancy vector databases. Clustering algos to reduce search space. A really neat custom O(n) algo that searched the set of possible solutions instead of the intersection of n^2 possible matches.
The old fashioned N^2 solution ended up being fastest, simplest, and could handle quite large Ns, when the core of the loop was optimized with popcnt (well xor -> popcnt). Computers are fast.