implement and use striped LRU cache to lower mutex contention (#15764)

* Implement Striped LRU cache

* ci

* fix

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Florent Peterschmitt
2020-12-09 14:55:14 +01:00
коммит произвёл GitHub
родитель 96d76760f0
Коммит 349b83f23a
34 изменённых файлов: 872 добавлений и 203 удалений

Просмотреть файл

@@ -22,14 +22,14 @@ func StoreOverride(override interface{}) Option {
return func(s *Server) error {
switch o := override.(type) {
case store.Store:
s.newStore = func() store.Store {
return o
s.newStore = func() (store.Store, error) {
return o, nil
}
return nil
case func(*Server) store.Store:
s.newStore = func() store.Store {
return o(s)
s.newStore = func() (store.Store, error) {
return o(s), nil
}
return nil