forked-synapse/synapse/util/caches
Richard van der Hoff fa5c2bc082 Reduce set building in get_entities_changed
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.
2018-07-12 11:37:44 +01:00
..
__init__.py run isort 2018-07-09 16:09:20 +10:00
descriptors.py run isort 2018-07-09 16:09:20 +10:00
dictionary_cache.py run isort 2018-07-09 16:09:20 +10:00
expiringcache.py run isort 2018-07-09 16:09:20 +10:00
lrucache.py run isort 2018-07-09 16:09:20 +10:00
response_cache.py replacing portions 2018-05-21 19:47:37 -05:00
snapshot_cache.py Fix up logcontexts 2016-02-08 14:26:45 +00:00
stream_change_cache.py Reduce set building in get_entities_changed 2018-07-12 11:37:44 +01:00
treecache.py Consistently use six's iteritems and wrap lazy keys/values in list() if they're not meant to be lazy (#3307) 2018-05-31 19:03:47 +10:00