From bc85922b00b6cffc28bb09ab8d9c01d18c7b0530 Mon Sep 17 00:00:00 2001 From: Yaroslav Surilov Date: Sat, 25 Nov 2023 21:00:56 +0200 Subject: [PATCH] feat(docs): update main readme --- README.md | 29 ++++++++++++++++++++++++----- lru-cache/readme.md | 6 +++++- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 85cb6c9..064a55a 100644 --- a/README.md +++ b/README.md @@ -5,17 +5,36 @@ ![Static Badge](https://img.shields.io/badge/cache_algorithms-7-f0e68c) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-blue.svg?style=flat)]() -

🐦

- +

--- -**No URURU, just LRU (and friends)** +## Motivation -Yet another cache implementations. But why? Yeah, there are a few reasons for that: +Yet another cache implementations. But why? Yeah, there are a few reasons for that. + +**Major reasons:** + +1. Research. +2. Education. +3. Fun. + +**Minor reasons:** + +1. To produce ready-to-use library well enough to just copy-paste into real project. + +There are also several let's say acceptance criteria and non-functional requirements which I follow here: 1. Simplicity in implementation means better _maintainability_. + +If in general it's usually true, this is very subjective if applied to implementations in this repository. Despite the fact that I try to maintain the lowest complexity level as it's possible and reasonable (without damage to performance in the first place), some specific decisions could probably be simplified. + 2. Simplicity in interface means better _learnability_ (see "ISO/IEC 9126 Software engineering — Product quality"). -3. Zero dependencies means more _predictability_, _safety_ and reduces overall application _size_. + +3. Zero dependencies to achieve better _predictability_, _safety_, reduces overall application _size_ and CI/CD duration. + +## General Theory + +When the cache becomes full, a cache block or record/entry must be evicted to make room for a new block. The replacement policy determines which block to evict. \ No newline at end of file diff --git a/lru-cache/readme.md b/lru-cache/readme.md index 0e3f63e..5749f32 100644 --- a/lru-cache/readme.md +++ b/lru-cache/readme.md @@ -1 +1,5 @@ -# Least Recently Used (LRU) cache \ No newline at end of file +# Least Recently Used (LRU) cache + +## Replacement policy + +LRU has a pretty practical replacement policy. \ No newline at end of file