Saturday, 31 August 2013

What hash function should I use for a bloom-filter with +128-bit keys?

What hash function should I use for a bloom-filter with +128-bit keys?

https://github.com/joeyrobert/bloomfilter uses Random class for the hash
function which is a performance killer.
What I'm trying to do is input the class with byte[]s instead of a generic
argument(T) and get rid of
private int Hash(T item) {
return item.GetHashCode();
}
I know there is a huge performance benefit but I have no idea how to replace
_bitArray[_random.Next(_bitSize)] = true;
With some non-retarded line of code that doesn't take thousands of CPU
cycles for every single bit.
I know there are lots of other problems with the code that can make it
faster/safer.I have them(mostly) fixed and just got stuck on the last one
before pushing my changes.
Any help is really appreciated.

No comments:

Post a Comment