Search code examples
pythonarrayslistbloom-filterbloom

Will using a bloom filter be faster than searching a dictionary or list in Python?


I have a file with a list of UUIDs for Assets (9000+) in my company. Now the basic task is importing that file into a list of UUID so that my program can loop and check if a number of other UUIDS match.

Now the question is, would using a bloom filter for the initial list allow me to do a quick search with the second list. would a bloom filter introduce any use in this case?

a) Learning bloom filters is something I want to do

b) would 9000+ Items in an array (list, dict) which I would need to loop through be efficient?

Many Thanks


Solution

  • A bloom filter would help you eliminate UUIDs that are not present in your list before searching. This can be useful if your lookup is otherwise very expensive. However a dictionary lookup is very fast due to hashing and using a bloom filter in this case likely won't net you much of an improvement.