Этот коммит содержится в:
Martin Kraft
2022-11-28 11:16:47 -05:00
коммит произвёл GitHub
родитель 860989e2ca
Коммит 98a14c8c55
6 изменённых файлов: 20 добавлений и 17 удалений

6
services/cache/lru_striped.go поставляемый
Просмотреть файл

@@ -29,9 +29,9 @@ import (
// cache where a simple LRU wouldn't have. Example:
//
// Two buckets B1 and B2, of max size 2 each, meaning, theoretically, a max size of 4:
// * Say you have a set of 3 keys, they could fill an entire LRU cache.
// * But if all those keys are assigned to a single bucket B1, the first key will be evicted from B1
// * B2 will remain empty, even though there was enough memory allocated
// - Say you have a set of 3 keys, they could fill an entire LRU cache.
// - But if all those keys are assigned to a single bucket B1, the first key will be evicted from B1
// - B2 will remain empty, even though there was enough memory allocated
//
// With 4 buckets and random UUIDs as keys, the amount of false evictions is around 5%.
//