Replying to Avatar ᴛʜᴇ ᴅᴇᴀᴛʜ ᴏꜰ ᴍʟᴇᴋᴜ

since the data is mutable probably a cuckoo filter is better

the benefit of using the filter is that when a relay is watching streams of events come in and a user has a subscription open this can eliminate a lot of work checking the list of follows

the filters sometimes false positive but they never false negative, so if the cuckoo filter says no then you can skip checking the follows list, if it says yes you have to check but the chances are pretty low that it will not be worth the dig

Avatar
the axiom 2y ago

I just did a benchmark and bloom filters are slower than default hashmaps with event ids for this job.

Reply to this note

Please Login to reply.

Discussion

Avatar
ᴛʜᴇ ᴅᴇᴀᴛʜ ᴏꜰ ᴍʟᴇᴋᴜ 2y ago

if you have the whole key table in memory then sure, of course it's no benefit lol

lmdb? how many gigabytes of memory?

Thread collapsed