summary refs log tree commit diff
path: root/synapse/events
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2016-03-29 01:20:25 +0100
committerMatthew Hodgson <matthew@matrix.org>2016-03-29 01:20:25 +0100
commite0c2490a145550310edb3ad0a414aa1840ef3ce4 (patch)
tree3d9ba7834e859171397ac7136ccb82123b4cd8ce /synapse/events
parentMerge branch 'develop' into matthew/preview_urls (diff)
parenttypo (diff)
downloadsynapse-e0c2490a145550310edb3ad0a414aa1840ef3ce4.tar.xz
Merge branch 'develop' into matthew/preview_urls
Diffstat (limited to 'synapse/events')
-rw-r--r--synapse/events/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py
index abed6b5e6b..23f8b612ae 100644
--- a/synapse/events/__init__.py
+++ b/synapse/events/__init__.py
@@ -14,6 +14,7 @@
 # limitations under the License.
 
 from synapse.util.frozenutils import freeze
+from synapse.util.caches import intern_dict
 
 
 # Whether we should use frozen_dict in FrozenEvent. Using frozen_dicts prevents
@@ -140,6 +141,10 @@ class FrozenEvent(EventBase):
 
         unsigned = dict(event_dict.pop("unsigned", {}))
 
+        # We intern these strings because they turn up a lot (especially when
+        # caching).
+        event_dict = intern_dict(event_dict)
+
         if USE_FROZEN_DICTS:
             frozen_dict = freeze(event_dict)
         else: