You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,18 +10,18 @@ go-generics-cache is an in-memory key:value store/cache that is suitable for app
10
10
- Simple cache is like `map[string]interface{}`
11
11
- See [examples](https://github.com/Code-Hex/go-generics-cache/blob/main/simple/example_test.go)
12
12
- Cache replacement policies
13
-
- Least recently used (LRU)
13
+
-**Least recently used (LRU)**
14
14
- Discards the least recently used items first.
15
15
- See [examples](https://github.com/Code-Hex/go-generics-cache/blob/main/lru/example_test.go)
16
-
- Least-frequently used (LFU)
16
+
-**Least-frequently used (LFU)**
17
17
- Counts how often an item is needed. Those that are used least often are discarded first.
18
18
-[An O(1) algorithm for implementing the LFU cache eviction scheme](http://dhruvbird.com/lfu.pdf)
19
19
- See [examples](https://github.com/Code-Hex/go-generics-cache/blob/main/lfu/example_test.go)
20
-
- First in first out (FIFO)
20
+
-**First in first out (FIFO)**
21
21
- Using this algorithm the cache behaves in the same way as a [FIFO queue](https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics)).
22
22
- The cache evicts the blocks in the order they were added, without any regard to how often or how many times they were accessed before.
23
23
- See [examples](https://github.com/Code-Hex/go-generics-cache/blob/main/fifo/example_test.go)
24
-
- Most recently used (MRU)
24
+
-**Most recently used (MRU)**
25
25
- In contrast to Least Recently Used (LRU), MRU discards the most recently used items first.
26
26
- See [examples](https://github.com/Code-Hex/go-generics-cache/blob/main/mru/example_test.go)
27
27
@@ -44,7 +44,7 @@ go version devel go1.18-c2397905e0 Sat Nov 13 03:33:55 2021 +0000 darwin/arm64
44
44
45
45
## Usage
46
46
47
-
See also [examples](https://github.com/Code-Hex/go-generics-cache/blob/main/example_test.go)
47
+
See also [examples](https://github.com/Code-Hex/go-generics-cache/blob/main/example_test.go) or [gotipplay playground](https://gotipplay.golang.org/p/MRF_I4oUS_W)
0 commit comments