This PR adds the possibility to test specific locations in a BloomFilter. In some scenarios that data items are tested very frequently for different BloomFilters. We can drastically improve performance if we pre-compute the hash locations of the items and test them.
Here is a simple example of how that could be used.
// precompute k hash locations for an item
locs := Locations(n1, k)
// test the item in multiple filters and return if found
for _, b := range filters {
if b.TestLocations(locs) {
return true
}
}
return false
This PR adds the possibility to test specific locations in a BloomFilter. In some scenarios that data items are tested very frequently for different BloomFilters. We can drastically improve performance if we pre-compute the hash locations of the items and test them.
Here is a simple example of how that could be used.