#3245 enhancement closed worksforme (worksforme)
__slots__ in Deferred class?
|Reported by:||Mekk||Owned by:|
|Cc:||glyph, radix, mgeisler||Branch:||
branch-diff, diff-cov, branch-cov, buildbot
|Author:||mgeisler, Mekk, exarkun|
Description (last modified by exarkun)
Programs which use a lot of Deferreds could benefit from __slots__.
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)
Changed 8 years ago by Mekk
Changed 8 years ago by mgeisler
comment:12 Changed 7 years ago by exarkun
- Keywords review removed
- Owner set to exarkun
- Status changed from new to assigned
comment:21 Changed 6 years ago by glyph
- Resolution set to worksforme
- Status changed from new to closed