-
Notifications
You must be signed in to change notification settings - Fork 176
Open
Description
while Expected number of inserts = 2000000,using Mur_mur3_128 hash likes Guava's BloomFilter and default fpp=0.01,your solution looks like doesn't work expectedly. Can you tell us how you compute the equation in Utils.getBitsPerItemForFpRate method.
code :
@Test
public void testInsert() {
CuckooFilter filter = new CuckooFilter.Builder(Funnels.integerFunnel(), 2000000).withHashAlgorithm(Algorithm.Murmur3_128).build();
//BloomFilter filter = BloomFilter.create(Funnels.integerFunnel(),2000000,0.01);
for (int i = 6000000; i < 8000000; i++) {
filter.put(i);
}
Stopwatch stopwatch = Stopwatch.createStarted();
int count = 0;
for (int i = 0; i < 1000000; i++) {
count += filter.mightContain(i) ? 1 : 0;
}
System.out.println("misjudgment num: " + count + " use:" + stopwatch.elapsed(TimeUnit.MILLISECONDS));
}
result:
misjudgment num: 29242 use:480
Metadata
Metadata
Assignees
Labels
No labels