Re: [pysnmp-users] Re: [Twisted-Python] Twisted and SNMP
Brought to you by:
elie
From: Ilya E. <il...@gl...> - 2004-02-11 10:39:44
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Post: <mailto:pys...@li...> List-Help: <mailto:pys...@li...?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=subscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> > Hmm, caching is fine, but it can only go so far, and it's often > detrimental to application structure and maintainability (particularly > when a library starts requiring client apps to do caching of internal That's right. I just wanted to point out a hint that improves SNMP manager performance whenever it performs multiple queries within its lifetime. That also holds true for SNMP agent as it's inherently deals with request message many times in row. > objects). All in all I'd rather spend the time speeding up the core > structures if/when I do wind up needing more speed. Right. In fact, I've been approaching that several times but there still might be plenty of things to improve. ;) > Looking at the asn.base module, it looks as though there's a lot of > internal structure being allocated for each ASN object, an instance > dictionary, and two or three lists. For most of those objects I'd guess > we could use __slots__ to reduce memory thrashing somewhat (about 26 > bytes/object + 8 bytes/(attribute*record) if my calculations are > right). Slots are a bit of a pain, but this is exactly the kind of > situation for which they are intended, huge numbers of tiny objects with > well-defined structure. Well, that's probably a way to go. I wonder, though, whether slot'ting instance variables would noticably save CPU cycles? [ skipped ] > Need to do a hotspot profile of running code to know what to start > working on. The initialisation code looks pretty involved in a number > of cases... anyway, no time tonight, have to work on application-level > stuff. That's right -- on instantiation or value assignment to an asn1.* object, ASN1 constraints checking code gets evaluated. -ilya |