summary refs log tree commit diff
path: root/synapse/util/caches/dictionary_cache.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* run isortAmber Brown2018-07-091-4/+5
|
* Disable partial state group caching for wildcard lookupsRichard van der Hoff2018-06-221-13/+12
| | | | | | | When _get_state_for_groups is given a wildcard filter, just do a complete lookup. Hopefully this will give us the best of both worlds by not filling up the ram if we only need one or two keys, but also making the cache still work for the federation reader usecase.
* replacing portionsAmber Brown2018-05-211-1/+1
|
* Fix bug where state cache used lots of memoryErik Johnston2018-03-151-1/+5
| | | | | | | | | The state cache bases its size on the sum of the size of entries. The size of the entry is calculated once on insertion, so it is important that the size of entries does not change. The DictionaryCache modified the entries size, which caused the state cache to incorrectly think it was smaller than it actually was.
* Make get_state_groups_from_groups faster.Erik Johnston2017-05-171-11/+46
| | | | | | | | | Most of the time was spent copying a dict to filter out sentinel values that indicated that keys did not exist in the dict. The sentinel values were added to ensure that we cached the non-existence of keys. By updating DictionaryCache to keep track of which keys were known to not exist itself we can remove a dictionary copy.
* Speed up cache size calculationErik Johnston2017-01-171-2/+4
| | | | | | | | | | | Instead of calculating the size of the cache repeatedly, which can take a long time now that it can use a callback, instead cache the size and update that on insertion and deletion. This requires changing the cache descriptors to have two caches, one for pending deferreds and the other for the actual values. There's no reason to evict from the pending deferreds as they won't take up any more memory.
* Change CacheMetrics to be quickerErik Johnston2016-06-031-4/+4
| | | | | | We change it so that each cache has an individual CacheMetric, instead of having one global CacheMetric. This means that when a cache tries to increment a counter it does not need to go through so many indirections.
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* Wire up the dictionarycache to the metricsErik Johnston2015-08-121-31/+25
|
* Move all the caches into their own package, synapse.util.cachesErik Johnston2015-08-111-0/+109