synapse-product/synapse/util/caches
Erik Johnston 119cb9bbcf Reduce cache size by not storing deferreds
Currently the cache descriptors store deferreds rather than raw values,
this is a simple way of triggering only one database hit and sharing the
result if two callers attempt to get the same value.

However, there are a few caches that simply store a mapping from string
to string (or int). These caches can have a large number of entries,
under the assumption that each entry is small. However, the size of a
deferred (specifically the size of ObservableDeferred) is signigicantly
larger than that of the raw value, 2kb vs 32b.

This PR therefore changes the cache descriptors to store the raw values
rather than the deferreds.

As a side effect cached storage function now either return a deferred or
the actual value, as the cached list decriptor already does. This is
fine as we always end up just yield'ing on the returned value
eventually, which handles that case correctly.
2017-04-25 10:23:11 +01:00
..
__init__.py Only intern ascii strings 2017-04-24 14:07:48 +01:00
descriptors.py Reduce cache size by not storing deferreds 2017-04-25 10:23:11 +01:00
dictionary_cache.py Speed up cache size calculation 2017-01-17 11:18:13 +00:00
expiringcache.py Add setdefault key to ExpiringCache 2017-03-10 10:30:49 +00:00
lrucache.py Update LruCache size estimate on clear 2017-01-18 14:55:23 +00:00
response_cache.py Cache federation state responses 2016-07-21 10:30:12 +01:00
snapshot_cache.py Fix up logcontexts 2016-02-08 14:26:45 +00:00
stream_change_cache.py Fix assertion to stop transaction queue getting wedged 2017-03-15 12:16:55 +00:00
treecache.py Rename and comment tree_to_leaves_iterator 2017-01-17 11:47:03 +00:00