Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the misjudgment rate equation work? #43

Open
AlaskaBay opened this issue Dec 5, 2021 · 0 comments
Open

Does the misjudgment rate equation work? #43

AlaskaBay opened this issue Dec 5, 2021 · 0 comments

Comments

@AlaskaBay
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant