summary refs log tree commit diff
path: root/tests/util/test_lrucache.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Replace assertEquals and friends with non-deprecated versions. (#12092)Patrick Cloke2022-02-281-70/+70
|
* Fix `LruCache` corruption bug with a `size_callback` that can return 0 (#11454)Sean Quah2021-11-301-0/+12
| | | | | | | | | | | When all entries in an `LruCache` have a size of 0 according to the provided `size_callback`, and `drop_from_cache` is called on a cache node, the node would be unlinked from the LRU linked list but remain in the cache dictionary. An assertion would be later be tripped due to the inconsistency. Avoid unintentionally calling `__len__` and use a strict `is None` check instead when unwrapping the weak reference.
* Add support for evicting cache entries based on last access time. (#10205)Erik Johnston2021-07-051-1/+45
|
* Remove `keylen` from `LruCache`. (#9993)Richard van der Hoff2021-05-241-2/+2
| | | | | | | `keylen` seems to be a thing that is frequently incorrectly set, and we don't really need it. The only time it was used was to figure out if we had removed a subtree in `del_multi`, which we can do better by changing `TreeCache.pop` to return a different type (`TreeCacheNode`). Commits should be independently reviewable.
* 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>`
* Use mock from the stdlib. (#9772)Patrick Cloke2021-04-091-1/+1
|
* Fix 'LruCache' object has no attribute '_on_resize' (#8591)Richard van der Hoff2020-10-191-1/+7
| | | We need to make sure we are readu for the `set_cache_factor` callback.
* Make LruCache register its own metrics (#8561)Richard van der Hoff2020-10-161-2/+2
| | | | | rather than have everything that instantiates an LruCache manage metrics separately, have LruCache do it itself.
* Allow configuration of Synapse's cache without using synctl or environment ↵Amber Brown2020-05-111-3/+3
| | | | variables (#6391)
* Run black.black2018-08-101-2/+0
|
* run isortAmber Brown2018-07-091-2/+2
|
* Tidy up testErik Johnston2017-01-171-12/+12
|
* Speed up cache size calculationErik Johnston2017-01-171-15/+15
| | | | | | | | | | | 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.
* Optionally measure size of cache by sum of length of valuesErik Johnston2017-01-131-0/+25
|
* Ensure invalidation list does not grow unboundedlyErik Johnston2016-08-191-0/+40
|
* Add concept of cache contextsErik Johnston2016-08-191-0/+113
|
* Add testsErik Johnston2016-01-291-0/+7
|
* Revert all the bits changing keys of eeverything that used LRUCaches to tuplesDavid Baker2016-01-221-22/+22
|
* Make LRU cache not default to treecache & add options to use itDavid Baker2016-01-221-1/+2
|
* Test treecache directlyDavid Baker2016-01-221-0/+19
|
* Change LRUCache to be tree-based so we can delete subtrees.David Baker2016-01-211-22/+22
|
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* Move all the caches into their own package, synapse.util.cachesErik Johnston2015-08-111-3/+1
|
* Add a lru cache classMark Haines2015-02-111-0/+56