Talk:Cache replacement policies

message: Shouldn't the latency be multiplied by the hit rate?  Otherwise it doesn't seem to be a proper weight average.  — Preceding unsigned comment added by 12.206.133.4 (talk) 06:00, 26 June 2013 (UTC)
thread_title: Mistake

message: As I understand it, the LRU algorithm keeps track of how many times each item has been used, so it can discard the item that have been used the fewest times. The MRU algorithm on the other hand just keeps a linked list and moves items to the front when they are accessed and discards from the back - that is, it discards the item that haven't been used for the longest time.
I am unable to find a good reference to confirm this, but the current description of the MRU is completely nonsensical: why would one want to discard the most recently used item?
Do anyone have a good reference? I am not certain about the correct definitions, just that the current one is wrong. Rasmus (talk) 22:06, 7 January 2009 (UTC)
replies: text: I looked a bit more into it, and it seems I am confusing LRU and LFU algorithms. But the section on MRU is clearly wrong. You get an MRU-cache by using an LRU-algorithm to select which item to remove. I will update the article to reflect this. Rasmus (talk) 22:15, 7 January 2009 (UTC)

text: OK, thanks for the references. I cleaned the section up a bit and moved it underneath the LRU algorithm (since it contrasts itself to that). Rasmus (talk) 20:13, 10 January 2009 (UTC)
thread_title:  Difference between LRU and MRU algorithms 

message: What is a "cache-line"? The term is used four times in the paragraph that describes the LRU algorithm but nowhere else, and nowhere is there an explanation of what it is. I'm guessing it basically means a "cache", and an LRU implementation may have several.
Also, I would have expected a description of the "lift-to-front" implementation of LRU caches, with all of the items in a linked list and every time one is accessed it's moved to the front of the list (actually, a bunch of pointers are swapped around). If A is ahead of B in the list then it means that A must have been accessed more recently than B (otherwise B would have been moved to the head of the list after A was so moved and would now be ahead of it). The implication is that every item in the list has been accessed since the most recent access of the item at the tail of the list - i.e., that the item at the tail is the least recently used. Those "age bits" would only come up if you had several caches ("cache-lines"?) in the same space because otherwise you'd not know the relative recencies of the different tails.  — Preceding unsigned comment added by 125.237.149.178 (talk) 09:14, 5 January 2017 (UTC)
thread_title:  LRU description 

message: While the code example shows that the normal LinkedHashMap can be used as LRU cache (be overriding a method) it does not explain anything about the LRU algorithm.
I would rather see a simple implementation of the LRU algorithm itself.
80.218.184.37 (talk) 19:24, 1 August 2009 (UTC)
thread_title:  Code Example 

message: Don't know a better way to report this, sorry !  — Preceding unsigned comment added by 91.245.11.185 (talk) 19:18, 18 April 2021 (UTC)
thread_title:  Source for [9] was moved 

message: The current introduction is:
In computing, cache algorithms (also frequently called cache replacement algorithms or cache replacement policies) are optimizing instructions, or algorithms, that a computer program or a hardware-maintained structure can utilize in order to manage a cache of information stored on the computer. Caching improves performance by keeping recent or often-used data items in memory locations that are faster or computationally cheaper to access than normal memory stores. When the cache is full, the algorithm must choose which items to discard to make room for the new ones.
I find this wordy and confusing. Suggest:
In computing, caches improve performance by keeping recent or often-used data items in memory locations that are faster or computationally cheaper to access than normal memory stores. Caches have limited size and thus data must be evicted to make room for new data. The cache replacement algorithm or cache replacement policy selects which data is evicted.
What do you think? David.Monniaux (talk) 20:10, 30 January 2023 (UTC)
thread_title:  Introduction