From: Ben Darnell Date: Wed, 24 Mar 2010 00:31:14 +0000 (-0700) Subject: Add __slots__ to ioloop._Timeout to reduce memory overhead when there are X-Git-Tag: v1.0.0~71^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e340491473498e7b67fd0e9e2e2a31d6b16ee20e;p=thirdparty%2Ftornado.git Add __slots__ to ioloop._Timeout to reduce memory overhead when there are many pending timeouts. --- diff --git a/tornado/ioloop.py b/tornado/ioloop.py index b2a105673..0d3083efe 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -297,6 +297,10 @@ class IOLoop(object): class _Timeout(object): """An IOLoop timeout, a UNIX timestamp and a callback""" + + # Reduce memory overhead when there are lots of pending callbacks + __slots__ = ['deadline', 'callback'] + def __init__(self, deadline, callback): self.deadline = deadline self.callback = callback