forked-synapse/synapse/storage
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
..
engines Optionally make committing to postgres asynchronous. 2016-06-20 17:53:38 +01:00
schema Add index to device_lists_stream 2017-03-01 15:56:30 +00:00
util Fix assertion to stop transaction queue getting wedged 2017-03-15 12:16:55 +00:00
__init__.py admin,storage: added more administrator functionalities 2017-02-02 14:02:26 +01:00
_base.py Use iter(items|values) 2017-03-24 10:57:02 +00:00
account_data.py User Cursor.__iter__ instead of fetchall 2017-03-23 17:53:49 +00:00
appservice.py Ignore AS users when fetching push rules 2016-11-23 11:01:01 +00:00
background_updates.py Remove broken use of clock.call_later 2017-03-18 00:01:37 +00:00
client_ips.py Bail on where clause instead 2017-04-11 16:24:31 +01:00
deviceinbox.py Deduplicate new deviceinbox rows for replication 2017-04-04 16:21:21 +01:00
devices.py Add new storage functions for new replication 2017-03-30 11:48:35 +01:00
directory.py Add some invalidations to a cache_stream 2016-08-15 11:15:17 +01:00
end_to_end_keys.py Decrank last commit 2017-03-29 11:02:35 +01:00
event_federation.py Use txn.fetchall() so we can reuse txn 2017-03-30 10:30:05 +01:00
event_push_actions.py User Cursor.__iter__ instead of fetchall 2017-03-23 17:53:49 +00:00
events.py Correct logic in is_event_after 2017-04-13 13:46:17 +01:00
filtering.py Fail with a coherent error message if /sync?filter= is invalid 2016-11-21 13:15:25 +00:00
keys.py fix up some key verif docstrings 2017-03-21 13:27:50 +00:00
media_repository.py Implement purge_media_cache admin API 2016-06-29 14:57:59 +01:00
openid.py Add an openidish mechanism for proving to third parties that you own a given user_id 2016-05-05 13:42:44 +01:00
prepare_database.py User Cursor.__iter__ instead of fetchall 2017-03-23 17:53:49 +00:00
presence.py Actually call invalidate 2017-03-24 13:28:20 +00:00
profile.py Add the create_profile method back since the tests use it 2016-06-17 19:20:47 +01:00
push_rule.py Ignore AS users when fetching push rules 2016-11-23 11:01:01 +00:00
pusher.py Fix up docs 2017-03-31 11:19:24 +01:00
receipts.py Reduce cache size by not storing deferreds 2017-04-25 10:23:11 +01:00
registration.py User Cursor.__iter__ instead of fetchall 2017-03-23 17:53:49 +00:00
rejections.py copyrights 2016-01-07 04:26:29 +00:00
room.py User Cursor.__iter__ instead of fetchall 2017-03-23 17:53:49 +00:00
roommember.py Cache hosts in room 2017-03-24 11:46:24 +00:00
search.py Remove spurious comment 2016-11-03 15:04:32 +00:00
signatures.py User Cursor.__iter__ instead of fetchall 2017-03-23 17:53:49 +00:00
state.py Remove unused cache 2017-04-24 13:27:38 +01:00
stream.py Assume rooms likely haven't changed 2017-03-13 09:50:10 +00:00
tags.py User Cursor.__iter__ instead of fetchall 2017-03-23 17:53:49 +00:00
transactions.py Fix tests and flake8 2016-11-22 18:18:31 +00:00