File: LIRS.md

package info (click to toggle)
core-cache-clojure 1.0.225-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 280 kB
  • sloc: xml: 43; sh: 28; makefile: 16
file content (27 lines) | stat: -rw-r--r-- 1,041 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
LIRS cache
==========

The low inter-reference recency set cache is one that, like [LRU](./LRU.md), uses recency as its basis for behavior.  Unlike, LRU however, LIRS uses access recency of other cache elements relative to any other block to determine its eviction policy.

*Before reading this page please make sure that you've read and understand the [Basic Usage patterns](./Using.md).*

General usage
-------------

To create a core.cache `LRUCache` instance you can do the following:

```clojure
    (ns your.lib 
      (:require [clojure.core.cache :as cache]))
	
    (def C (cache/lirs-cache-factory {}))
```

Most of the trival examples will likely look very similar to the examples found in the [LRU](./LRU.md) page.  See the discussion in the next section why you might wish to choose LIRS instead.

Like all of the implementations in core.cache, `LRUCache` instances operate like regular maps and are immutable. All caveats apply regarding the [proper usage patterns](./Using.md).

LIRS cache use cases
--------------------

TODO