Skip to content

Commit f8c1fa9

Browse files
committed
fix CCACHE-64
1 parent 63aeed0 commit f8c1fa9

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

docs/LRU.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
LRU cache
22
==========
33

4-
The least-recently-used cache is one that evicts items that are accessed least frequently once its threshold has been exceeded.
4+
The least-recently-used cache is one that evicts items that are accessed least recently once its threshold has been exceeded.
55

66
> In simple terms, the LRU cache will remove the element in the cache that has not been accessed in the longest time.
77
@@ -13,11 +13,11 @@ General usage
1313
To create a core.cache `LRUCache` instance you should *always* use its associated constructor function `lru-cache-factory` with an optional `:threshold` parameter:
1414

1515
```clojure
16-
(ns your.lib
16+
(ns your.lib
1717
(:require [clojure.core.cache :as cache]))
18-
18+
1919
(def C (cache/lru-cache-factory {} :threshold 2))
20-
20+
2121
(-> C (assoc :a 1) (assoc :b 2))
2222
;=> {:a 1, :b 2}
2323
```
@@ -34,11 +34,11 @@ At this point the cache has not yet crossed the set threshold of `2`, but if you
3434
At this point the operation of the LRU cache looks exactly the same at the FIFO cache. However, the difference becomes apparent when a given cache item is "touched":
3535

3636
```clojure
37-
(-> C (assoc :a 1)
38-
(assoc :b 2)
37+
(-> C (assoc :a 1)
38+
(assoc :b 2)
3939
(.hit :a) ;; ensure :a is used most recently
4040
(assoc :c 3))
41-
41+
4242
;=> {:a 1, :c 3}
4343
```
4444

@@ -67,5 +67,5 @@ There are a few reasons why you might want to use a LRU cache:
6767
* Tends to perform poorly when elements files are accessed occasionally but consistently while other elements are accessed very frequently for a short duration and never accessed again
6868
* It requires more historical data to operate
6969
* It requires a larger cache to increase efficiency
70-
70+
7171
As always, you should measure your system's characteristics to determine the best eviction strategy for your purposes.

0 commit comments

Comments
 (0)