summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-05-17 14:31:23 +0100
committerErik Johnston <erik@matrix.org>2017-05-17 15:12:15 +0100
commitbbfe4e996c9b9729f19d5b104dc6abfe120531b4 (patch)
tree899deacf0159b07f84271abdb58c6ca4b02677c6 /tests
parentMerge branch 'release-v0.21.0' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-bbfe4e996c9b9729f19d5b104dc6abfe120531b4.tar.xz
Make get_state_groups_from_groups faster.
Most of the time was spent copying a dict to filter out sentinel values
that indicated that keys did not exist in the dict. The sentinel values
were added to ensure that we cached the non-existence of keys.

By updating DictionaryCache to keep track of which keys were known to
not exist itself we can remove a dictionary copy.
Diffstat (limited to 'tests')
-rw-r--r--tests/util/test_dict_cache.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/util/test_dict_cache.py b/tests/util/test_dict_cache.py
index 272b71034a..bc92f85fa6 100644
--- a/tests/util/test_dict_cache.py
+++ b/tests/util/test_dict_cache.py
@@ -28,7 +28,7 @@ class DictCacheTestCase(unittest.TestCase):
         key = "test_simple_cache_hit_full"
 
         v = self.cache.get(key)
-        self.assertEqual((False, {}), v)
+        self.assertEqual((False, set(), {}), v)
 
         seq = self.cache.sequence
         test_value = {"test": "test_simple_cache_hit_full"}