SNMP Toolkit

Ilya Etingof ilya at
Fri Jun 25 09:55:25 CEST 2004

Michael Str?der <michael at> wrote:

[ skipped ]

> AFAIK the BER encoding/decoding is implemented in pure Python. If one has 
> the time to implement these routines in C it'd be much less CPU intensive I 
> guess.

I've got an impression, that building/parsing BER is not computationally
intensive. In fact, BER encoding has been designed to cope with rather limited
resources (in terms of about 20 yo hardware!).

As an alternative bottleneck I'd rather propose 1) object instantiation and
2) function calls. As of this writing, pysnmp.asn1 code is designed as a top-down
parser what implies intensive recursion and object creation. Although not a real
receipt but rater a workaround, I'd suggest caching and reusing top-level
ASN.1/SNMP objects (such as SNMP message) inside your app whenever possible.
This might safe lots of CPU on a long run.


More information about the Python-list mailing list