#3245 enhancement closed worksforme (worksforme)
__slots__ in Deferred class?
|Reported by:||Marcin Kasperski||Owned by:|
|Cc:||Glyph, radix, mgeisler||Branch:||
branch-diff, diff-cov, branch-cov, buildbot
|Author:||mgeisler, Mekk, exarkun|
Description (last modified by )
Programs which use a lot of Deferreds could benefit from
Simple test I did proved, that the program which created huge list of empty Deferreds had its memory usage (both RSS anv VSS) halved after such a change (longer post on the mailing list)
Important impact: d.some_unknown_attribute=something will fail. What can be ... a good thing, as it would catch some cases of deferred being mistakenly used as if it was real object.
The change is fairly small (defer.py):
class Deferred(object): __slots__ = ['debug', 'callbacks', 'called', 'paused', 'result', 'timeoutCall', '_runningCallbacks', '_debugInfo']
Change History (24)
comment:12 Changed 8 years ago by
|Owner:||set to Jean-Paul Calderone|
|Status:||new → assigned|