synapse-product/synapse
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
..
api use jsonschema.FormatChecker for RoomID and UserID strings 2017-03-23 11:42:41 -03:00
app Merge pull request #2115 from matrix-org/erikj/dedupe_federation_repl 2017-04-12 11:07:13 +01:00
appservice Add comment 2017-03-29 09:50:05 +01:00
config trust a hypothetical future riot.im IS 2017-04-10 17:58:36 +01:00
crypto Merge pull request #2050 from matrix-org/rav/federation_backoff 2017-03-23 22:27:01 +00:00
events Refactoring and cleanups 2017-03-17 15:06:07 +00:00
federation Merge pull request #2115 from matrix-org/erikj/dedupe_federation_repl 2017-04-12 11:07:13 +01:00
handlers m.read_marker -> m.fully_read (#2128) 2017-04-18 17:46:15 +01:00
http try not to drop context after federation requests 2017-03-23 22:36:21 +00:00
metrics Rearrange metrics 2017-04-05 14:15:09 +01:00
push Support authenticated SMTP 2017-04-05 21:01:08 -07:00
replication Remove unused cache 2017-04-24 13:27:38 +01:00
rest m.read_marker -> m.fully_read (#2128) 2017-04-18 17:46:15 +01:00
static/client Updates to fallback CAS login to do new token login 2015-11-06 09:57:17 +00:00
storage Reduce cache size by not storing deferreds 2017-04-25 10:23:11 +01:00
streams Add basic implementation of local device list changes 2017-01-25 14:27:27 +00:00
util Reduce cache size by not storing deferreds 2017-04-25 10:23:11 +01:00
__init__.py Bump version and changelog 2017-04-07 10:03:48 +01:00
event_auth.py Use better variable name 2017-01-17 14:32:53 +00:00
notifier.py Merge branch 'develop' of github.com:matrix-org/synapse into erikj/repl_tcp_server 2017-04-04 09:46:16 +01:00
python_dependencies.py Add jsonschema to python_dependencies.py 2017-03-23 11:42:47 -03:00
server.py Finish implementing RM endpoint 2017-04-11 15:01:39 +01:00
server.pyi Fix login with m.login.token 2016-08-08 16:40:39 +01:00
state.py Merge pull request #1849 from matrix-org/erikj/state_typo 2017-03-29 11:53:42 +01:00
types.py Speed up copy_and_replace 2017-03-30 17:50:31 +01:00
visibility.py Don't convert to deferreds when not necessary 2017-03-30 14:14:36 +01:00