Closed rajatjain1997 closed 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.
Added LFU Cache in commit ead8763ae89d9e3bf6236e9a30b4d1974263a729
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.