summary refs log tree commit diff
path: root/synapse/util/caches/stream_change_cache.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Run Black. (#5482)Amber Brown2019-06-201-6/+7
|
* Make scripts/ and scripts-dev/ pass pyflakes (and the rest of the codebase ↵Amber Brown2018-10-201-1/+3
| | | | on py3) (#4068)
* Use efficient .intersectionErik Johnston2018-07-171-4/+1
|
* Fix perf regression in PR #3530Erik Johnston2018-07-171-1/+6
| | | | | | | | The get_entities_changed function was changed to return all changed entities since the given stream position, rather than only those changed from a given list of entities. This resulted in the function incorrectly returning large numbers of entities that, for example, caused large increases in database usage.
* Don't return unknown entities in get_entities_changedErik Johnston2018-07-131-8/+1
| | | | | | | | The stream cache keeps track of all entities that have changed since a particular stream position, so get_entities_changed does not need to return unknown entites when given a larger stream position. This makes it consistent with the behaviour of has_entity_changed.
* Reduce set building in get_entities_changedRichard van der Hoff2018-07-121-8/+12
| | | | | | | | | | | This line shows up as about 5% of cpu time on a synchrotron: not_known_entities = set(entities) - set(self._entity_to_key) Presumably the problem here is that _entity_to_key can be largeish, and building a set for its keys every time this function is called is slow. Here we rewrite the logic to avoid building so many sets.
* run isortAmber Brown2018-07-091-3/+2
|
* Revert "Revert "Try to not use as much CPU in the StreamChangeCache"" (#3454)Amber Brown2018-06-281-2/+4
|
* Revert "Try to not use as much CPU in the StreamChangeCache"Matthew Hodgson2018-06-261-4/+2
|
* fixesAmber Brown2018-06-261-2/+2
|
* fixesAmber Brown2018-06-261-2/+2
|
* try and make loading items from the cache fasterAmber Brown2018-06-261-2/+4
|
* Port to sortedcontainers (with tests!) (#3332)Amber Brown2018-06-061-26/+31
|
* replacing portionsAmber Brown2018-05-211-1/+1
|
* Revert "Use sortedcontainers instead of blist"Richard van der Hoff2018-04-131-2/+2
| | | | | | | | | | | This reverts commit 9fbe70a7dc3afabfdac176ba1f4be32dd44602aa. It turns out that sortedcontainers.SortedDict is not an exact match for blist.sorteddict; in particular, `popitem()` removes things from the opposite end of the dict. This is trivial to fix, but I want to add some unit tests, and potentially some more thought about it, before we do so.
* Use sortedcontainers instead of blistVincent Breitmoser2018-04-101-2/+2
| | | | | | | | This commit drop-in replaces blist with SortedContainers. They are written in pure python so work with pypy, but perform as good as native implementations, at least in a couple benchmarks: http://www.grantjenks.com/docs/sortedcontainers/performance.html
* Define CACHE_SIZE_FACTOR onceErik Johnston2017-07-041-5/+1
|
* Rewrite conditionalErik Johnston2017-06-091-1/+1
|
* Fix has_any_entity_changedErik Johnston2017-06-091-4/+4
| | | | | | | | Occaisonally has_any_entity_changed would throw the error: "Set changed size during iteration" when taking the max of the `sorteddict`. While its uncertain how that happens, its quite inefficient to iterate over the entire dict anyway so we change to using the more traditional `bisect_*` functions.
* Add stream change cacheErik Johnston2017-05-311-0/+15
|
* Fix assertion to stop transaction queue getting wedgedRichard van der Hoff2017-03-151-1/+1
| | | | | | | | ... and update some docstrings to correctly reflect the types being used. get_new_device_msgs_for_remote can return a long under some circumstances, which was being stored in last_device_list_stream_id_by_dest, and was then upsetting things on the next loop.
* Change get_pos_of_last_change to return upper boundErik Johnston2016-09-151-3/+4
|
* Use stream_change cache to make get_forward_extremeties_for_room cache more ↵Erik Johnston2016-09-151-0/+5
| | | | effective
* Change CacheMetrics to be quickerErik Johnston2016-06-031-8/+8
| | | | | | 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.
* Return list, not generator.Erik Johnston2016-03-141-3/+1
|
* Limit stream change cache size tooErik Johnston2016-03-011-1/+5
|
* Change the way we figure out presence updates for small deltasErik Johnston2016-02-231-0/+16
|
* If stream pos is greater then earliest known key and entity hasn't changed, ↵Erik Johnston2016-01-291-8/+3
| | | | then entity hasn't changed
* Prefill stream change cachesErik Johnston2016-01-291-1/+4
|
* If the same as the earliest key, assume nothing has changed.Erik Johnston2016-01-281-0/+5
|
* Correctly update _entity_to_keyErik Johnston2016-01-281-4/+5
|
* Fix inequalitiesErik Johnston2016-01-281-2/+2
|
* Include cache hits with has_entity_changedErik Johnston2016-01-281-0/+4
|
* Change name and doc has_entity_changedErik Johnston2016-01-281-1/+3
|
* Cache tags and account dataErik Johnston2016-01-281-0/+95