Closed lynnliu030 closed 2 years ago
Hi there,
For the case of new items, the frequency should be the smallest value or base frequency (1 from the code above). Frequency is only incremented whenever we encounter a hit in history, which means items that have been previously evicted from cache but are still in history (these items do not fall into the newly-added item's category because they have been seen before).
Also, in this implementation, we started counting from 1 instead of 0 which is just a shift in the values of the stored frequency distribution and does not have any impact on the correctness of the algorithm or the eviction sequence.
Thanks for the interest!
Closing due to no activity.
Hi, I have a question related to the LeCaR implementation in this repo.
In this case, the frequency of the newly-added object is the old frequency (before eviction) + 1. Why is this the case? The new object should have frequency of 1 considering that it has been evicted already by the cache, is that right?