ContentHolmes / Content-Holmes

Content Holmes is a one-click AI-based online parenting solution that helps you to keep your children secure from cyber-bullying and adult content online and monitor their activities.
https://www.contentholmes.com
GNU Affero General Public License v3.0
6 stars 4 forks source link

Use BloomFilters for faster searching on URLBlocker & URLBlock #33

Closed rajatjain1997 closed 7 years ago

rajatjain1997 commented 7 years ago

The current implementation uses arrays. Switching to bloom-filters would be better for memory as well. However we need to account for false positives and check for them as well. I guess that should not matter we can do the learning analysis fast enough. Also, we can move the filter onto the server and update it periodically.

A more concrete implementation needs to be thought of.

rajatjain1997 commented 7 years ago

It is not a Bloom Filter. We need false negatives, so LRUCache is something to look at here on Stack An implementation can be found at Geeks

anikl9705 commented 7 years ago

Check out https://www.npmjs.com/package/js-lru-cache. But it seems like we need our own hash function. Anyways, we will still be needing a lot of storage space for this as well. But access will be faster.

rajatjain1997 commented 7 years ago

Added LFU Cache in commit ead8763ae89d9e3bf6236e9a30b4d1974263a729