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 удалений

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

@@ -334,13 +334,13 @@ type publicChannel struct {
Purpose string `json:"purpose"`
}
var allChannelMembersForUserCache = cache.NewLRU(&cache.LRUOptions{
var allChannelMembersForUserCache = cache.NewLRU(cache.LRUOptions{
Size: ALL_CHANNEL_MEMBERS_FOR_USER_CACHE_SIZE,
})
var allChannelMembersNotifyPropsForChannelCache = cache.NewLRU(&cache.LRUOptions{
var allChannelMembersNotifyPropsForChannelCache = cache.NewLRU(cache.LRUOptions{
Size: ALL_CHANNEL_MEMBERS_NOTIFY_PROPS_FOR_CHANNEL_CACHE_SIZE,
})
var channelByNameCache = cache.NewLRU(&cache.LRUOptions{
var channelByNameCache = cache.NewLRU(cache.LRUOptions{
Size: model.CHANNEL_CACHE_SIZE,
})