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

Why 'cfAddNX' so many misjudgement? #50

Open
scallionshen opened this issue Aug 18, 2022 · 1 comment
Open

Why 'cfAddNX' so many misjudgement? #50

scallionshen opened this issue Aug 18, 2022 · 1 comment

Comments

@scallionshen
Copy link

scallionshen commented Aug 18, 2022

I am doing some test of Cuckoo Filter with data set of range(1, 1e8)

redis_cuckoo.cfCreate(CK_FID, 100000000, bucket_size=10, ) cnt = 0 duplicate_cnt = 0 for i in range(100000000): exist = not bool(redis_cuckoo.cfAddNX(CK_FID, i)) cnt += 1 if cnt % 10000 == 0: print(cnt, duplicate_cnt) if exist: duplicate_cnt += 1

After nearly 1000k elements was added , error count was about ~22k, which make no sense for me .
can anybody give me some guidance. TYVM!

@ashtul
Copy link
Contributor

ashtul commented Aug 18, 2022

Hi @scallionshen,
I have tested the same parameters and got 230 duplicates at 1M, 23k at 10M and 93k at 20M.
Please note, for you backet size, the error rate of the filter when almost full will be almost 10%. The fingerprint has 255 different values and each element would have 2 locations * 10 buckets elements to try and match.

BTW, why won't you use our Bloom Filter since you are not looking to delete values?

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

No branches or pull requests

2 participants