summary refs log tree commit diff
path: root/synapse/util/caches/dictionary_cache.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant types from comments. (#14412)Patrick Cloke2022-11-161-4/+5
| | | | | | | Remove type hints from comments which have been added as Python type hints. This helps avoid drift between comments and reality, as well as removing redundant information. Also adds some missing type hints which were simple to fill in.
* Make DictionaryCache have better expiry properties (#13292)Erik Johnston2022-07-211-31/+187
|
* Use auto_attribs/native type hints for attrs classes. (#11692)Patrick Cloke2022-01-131-6/+5
|
* Add type hints to state database module. (#10823)Patrick Cloke2021-09-151-2/+2
|
* Add types to synapse.util. (#10601)reivilibre2021-09-101-10/+14
|
* Use inline type hints in `http/federation/`, `storage/` and `util/` (#10381)Jonathan de Jong2021-07-151-3/+3
|
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Add type hints to DictionaryCache and TTLCache. (#9442)Patrick Cloke2021-03-291-21/+43
|
* type annotations for LruCacheRichard van der Hoff2020-10-161-9/+13
|
* Make LruCache register its own metrics (#8561)Richard van der Hoff2020-10-161-8/+1
| | | | | rather than have everything that instantiates an LruCache manage metrics separately, have LruCache do it itself.
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-2/+2
|
* Run Black. (#5482)Amber Brown2019-06-201-6/+9
|
* 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