4 ms·
So this made me think of spaced repetition, which is based on how the brain retains memories. I wonder if you could make a cache retention algorithm similar to
by im3w1l 3y ago
So this made me think of spaced repetition, which is based on how the brain retains memories. I wonder if you could make a cache retention algorithm similar to what the brain uses.
I'm thinking something like this:
Every entry has two values "solidity" and "time since last seen". When an entry is accessed solidity increases based on time since last seen - if it was a short while ago it increases just a little, longer means bigger increase. This is to ensure that solidity will correspond roughly to the long term need for the entry and doesn't go up too much if something is accessed a lot of times in quick succession.
Entries with low solidity and long time-since-last-seen are evicted.
- NovaX 3y agoThat could work efficiently in a sampled caching policy. For example, Hyperbolic [1] maintains the frequency and insertion time on each entry and evicts the entry in the sample with the least utility value of frequency / (currentTime - insertionTime). For yours, you could easily add it to the SampledPolicy in this simulator [2] and run it against a few traces to see how it compares. [1] https://www.usenix.org/system/files/conference/atc17/atc17-blankstein.pdf https://www.usenix.org/system/files/conference/atc17/atc17-b... [2] https://github.com/ben-manes/caffeine/wiki/Simulator https://github.com/ben-manes/caffeine/wiki/Simulator
- NovaX 3y agoOr the author’s simulator if you prefer C. See their hyperbolic for an example. https://github.com/1a1a11a/libCacheSim/blob/develop/libCacheSim/cache/eviction/Hyperbolic.c https://github.com/1a1a11a/libCacheSim/blob/develop/libCache...