Re: [lisp-snmp] Changing the representation of OIDs
Brought to you by:
binghe
From: John F. <jf...@ms...> - 2009-05-01 08:29:53
|
Dear Chun Tian, Thanks again, I will test your new patch after the Golden Week "Chun Tian (binghe)" <bin...@gm...> writes: [...] > A SIMPLE-OID is a special ASN.1 object ID which have less slots than a > normal OBJECT-ID: > > (defclass base-oid (asn.1-type) > ((parent :type object-id > :reader oid-parent > :initarg :parent))) > > (defclass simple-oid (base-oid) > ((values :type list > :reader oid-number-list > :initarg :values) > (length :type fixnum > :reader oid-length)) Seeing as the complex OID also has these slots, why not include them in base-oid? With a vector representation you only need one slot as the length is O(1) > (:documentation "A simple OID implementation")) > > I still use a LIST to hold the oid number list because this can best > fit most of exist code. Would you accept a patch to convert it over to vectors There are many places where we might better use vectors than lists (e.g. ber-decode-type which unfortunately does plenty of unnecessary consing). [...] > You can see, for (OID "sysDescr.0") and (OID '(1 3 6 1 2 1 1 1 0)) , > it returns a SIMPLE-OID instance instead of OBJECT-ID now. The rule > is: if the object id ends with unnamed number lists, a SIMPLE-OID will > return instead. I think lots of work can be saved here. Thanks, I this is we have taken out the top memory wasters out of our program, which might be enough to make the customer a bit happier. Mr Kuroda was threatening to try to get me to specify the amount of memory required by the program -- perhaps that will be a bit simpler now (but not much ;-). [...] |