summaryrefslogtreecommitdiff
path: root/slixmpp/roster
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2016-08-22 01:29:07 +0200
committermathieui <mathieui@mathieui.net>2016-08-22 01:29:07 +0200
commit52cd8f4b226f22f78eae997212073011716cdd08 (patch)
tree12d502e9411a395bd165a531efc754331790277b /slixmpp/roster
parente28318c2711a1a3410fcefe2a6f292656056aeb3 (diff)
downloadslixmpp-52cd8f4b226f22f78eae997212073011716cdd08.tar.gz
slixmpp-52cd8f4b226f22f78eae997212073011716cdd08.tar.bz2
slixmpp-52cd8f4b226f22f78eae997212073011716cdd08.tar.xz
slixmpp-52cd8f4b226f22f78eae997212073011716cdd08.zip
Don’t trigger presence events on MUC presence
Specifically, previously, each MUC would be added as a roster item, and then each join presence would be counted as a resource of that item, triggering 1 to 5 events and more backend logic in slixmpp. As a result, joining big rooms is tremendously slow, (JID() calls, event() calls, __getitem__ calls for nothing), and takes RAM (a quick tracemalloc tells me around 1 MiB for 3500 participants, i.e. 2 big IRC rooms). Those resources may not necessarily be cleaned properly, leading to memory leaks on long-term usage. This is a micro-optimization that adds an attribute to roster items so that MUC room events can be ignored safely while not affecting common roster usage.
Diffstat (limited to 'slixmpp/roster')
-rw-r--r--slixmpp/roster/single.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/slixmpp/roster/single.py b/slixmpp/roster/single.py
index 62fbca41..3961cddf 100644
--- a/slixmpp/roster/single.py
+++ b/slixmpp/roster/single.py
@@ -56,6 +56,7 @@ class RosterNode(object):
self.xmpp = xmpp
self.jid = jid
self.db = db
+ self.ignore_updates = False
self.auto_authorize = True
self.auto_subscribe = True
self.last_status = None