summaryrefslogtreecommitdiff
path: root/src/events.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2015-05-08 20:37:21 +0200
committermathieui <mathieui@mathieui.net>2015-05-08 20:37:21 +0200
commitdfd60426d8da06c817c6d3f71901b4f1c013a819 (patch)
tree79fb8cf31b623cdd846311a0761b34a7b6cfb549 /src/events.py
parent3171c96eed40d24b3200a8f2af1da9bc7619ab39 (diff)
downloadpoezio-dfd60426d8da06c817c6d3f71901b4f1c013a819.tar.gz
poezio-dfd60426d8da06c817c6d3f71901b4f1c013a819.tar.bz2
poezio-dfd60426d8da06c817c6d3f71901b4f1c013a819.tar.xz
poezio-dfd60426d8da06c817c6d3f71901b4f1c013a819.zip
Micro-optimizations on refresh
Reduce the number of calls to config.get whenever possible. Yields a performance improvement of at least 10% for the basic use case of "receiving a message in the current tab". Logging stuff isn’t free either, even when the call should be a no-op, so we should try to make the debug log less verbose.
Diffstat (limited to 'src/events.py')
-rw-r--r--src/events.py5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/events.py b/src/events.py
index 50711022..15ef3e35 100644
--- a/src/events.py
+++ b/src/events.py
@@ -10,9 +10,6 @@ The list of available events is here:
http://poezio.eu/doc/en/plugins.html#_poezio_events
"""
-import logging
-log = logging.getLogger(__name__)
-
class EventHandler(object):
"""
A class keeping a list of possible events that are triggered
@@ -71,9 +68,7 @@ class EventHandler(object):
"""
callbacks = self.events.get(name, None)
if callbacks is None:
- log.debug('%s: No such event.', name)
return
- log.debug('Event %s triggered, callbacks: %s', name, callbacks)
for callback in callbacks:
callback(*args, **kwargs)