Re: [lisp-snmp] Memory usage of ASN.1 library
Brought to you by:
binghe
From: Chun T. (binghe) <bin...@gm...> - 2009-05-01 05:24:04
|
Hi, John I believe the bug involved in my last patch is in function ASN.1:OID- <, below is a updated version: (defun oid-< (oid-1 oid-2) "test if oid-1 is oid-2's child" (let ((o-1 (reverse (oid-number-list oid-1))) (o-2 (reverse (oid-number-list oid-2))) (o-1-len (oid-length oid-1)) (o-2-len (oid-length oid-2))) (if (<= o-1-len o-2-len) nil (equal o-2 (nthcdr (- o-1-len o-2-len) o-1))))) There're two REVERSE which were NREVERSE. This cause the cached OID- NUMBER-LIST list been incorrectly destroyed. By using above new version of OID-<, I think SNNP-WALK works now. Would you help me finding a more optimized version of OID-< which didn't do any consing? Maybe you can do better than me here by using LOOP? Regards, Chun Tian (binghe) 在 2009-5-1,09:09, John Fremlin 写道: > Dear Chun Tian, > > "Chun Tian (binghe)" <bin...@gm...> writes: > [...] >> First, I should say sorry for my delay on the work of "runtime MIB >> loading". I've been hired as a commercial Lisp programmer since one >> month ago, and I don't have much time working on cl-net-snmp these >> days. I hope I can have some time to finish it in next month. >> However, >> you (and MSI) are still my big "client" :) > > Good luck and have fun dealing with your bosses in Bangalore. > > [...] > >> For optimize, I want to add two more slots in class OBJECT-ID: VALUES >> (to hold the cache of "oid number list" and "oid length"). This is >> reasonable because a OBJECT-ID instance won't change their "oid >> number >> list" once created, so calculate it just once will work. > > Yes, as you saw from my email this was more or less my suggestion > and I > had already tried it. > > The trouble is that for some reason it causes SNMP walks to no longer > work. An object ID is created, its number-list is taken, then it is > modified. > >> (snmp:snmp-walk "127.0.0.1" ".1") > #<SNMP::SMI NO-SUCH-OBJECT (0)> > > I guess there is no hope but to actually fix the problem and delve > even > further into ASN.1. > > I was hoping that you might already have a plan to start using simple > vectors of integers as OIDs. Using lists/instances is more > complicated and wasteful. > > PS. Why do you hate loop and iterate so much? |