summary refs log tree commit diff
path: root/synapse/util/caches/treecache.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Speed up `@cachedList` (#13591)Erik Johnston2022-08-231-0/+3
| | | | | | | | | This speeds things up by ~2x. The vast majority of the time is now spent in `LruCache` moving things around the linked lists. We do this via two things: 1. Don't create a deferred per-key during bulk set operations in `DeferredCache`. Instead, only create them if a subsequent caller asks for the key. 2. Add a bulk lookup API to `DeferredCache` rather than use a loop.
* Make DictionaryCache have better expiry properties (#13292)Erik Johnston2022-07-211-0/+38
|
* Remove unnecessary pass statements. (#12206)Patrick Cloke2022-03-111-2/+0
|
* Add types to synapse.util. (#10601)reivilibre2021-09-101-8/+8
|
* [pyupgrade] `synapse/` (#10348)Jonathan de Jong2021-07-191-2/+1
| | | | | | | | | This PR is tantamount to running ``` pyupgrade --py36-plus --keep-percent-format `find synapse/ -type f -name "*.py"` ``` Part of #9744
* Combine `LruCache.invalidate` and `invalidate_many` (#9973)Richard van der Hoff2021-05-271-0/+3
| | | | | | | | | | * Make `invalidate` and `invalidate_many` do the same thing ... so that we can do either over the invalidation replication stream, and also because they always confused me a bit. * Kill off `invalidate_many` * changelog
* Remove `keylen` from `LruCache`. (#9993)Richard van der Hoff2021-05-241-38/+66
| | | | | | | `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.
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-2/+2
|
* Replace iteritems/itervalues/iterkeys with native versions. (#7692)Patrick Cloke2020-06-151-3/+1
|
* Fix up some typechecking (#6150)Amber Brown2019-10-021-1/+3
| | | | | | * type checking fixes * changelog
* Run Black. (#5482)Amber Brown2019-06-201-0/+1
|
* Consistently use six's iteritems and wrap lazy keys/values in list() if ↵Amber Brown2018-05-311-2/+4
| | | | they're not meant to be lazy (#3307)
* Rename and comment tree_to_leaves_iteratorErik Johnston2017-01-171-3/+6
|
* Speed up cache size calculationErik Johnston2017-01-171-1/+13
| | | | | | | | | | | 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.
* Add concept of cache contextsErik Johnston2016-08-191-0/+3
|
* Fix flake8 warnings for new flake8Daniel Wagner-Hall2016-02-021-1/+1
|
* Directly set self.valueErik Johnston2016-01-291-1/+1
|
* Correctly bookkeep the size of TreeCacheErik Johnston2016-01-291-3/+28
|
* Make TreeCache keep track of its own size.Erik Johnston2016-01-291-0/+7
|
* Add __contains__David Baker2016-01-221-0/+3
|
* Docs for treecacheDavid Baker2016-01-221-0/+5
|
* peppateDavid Baker2016-01-211-2/+2
|
* Change LRUCache to be tree-based so we can delete subtrees.David Baker2016-01-211-0/+52