Re: [lisp-snmp] Memory usage of ASN.1 library
Brought to you by:
binghe
From: Chun T. (binghe) <bin...@gm...> - 2009-04-30 15:22:52
|
Hi, John 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" :) I understand heavily calls to OID-NUMBER-LIST will cause consing too much. 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. Actual test shows that, by using this cache, repeated calls to OID- NUMBER-LIST on the "same" oid instance won't cons any more after the first call: ASN.1 14 > (time (oid-number-list (oid "system"))) Timing the evaluation of (OID-NUMBER-LIST (OID "system")) User time = 0.000 System time = 0.000 Elapsed time = 0.000 Allocation = 900 bytes 0 Page faults (1 3 6 1 2 1 1) ASN.1 15 > (time (oid-number-list (oid "system"))) Timing the evaluation of (OID-NUMBER-LIST (OID "system")) User time = 0.000 System time = 0.000 Elapsed time = 0.000 Allocation = 24 bytes 0 Page faults (1 3 6 1 2 1 1) Please test the new ASN.1 patch (4-16.lisp) in attach, it's a loadable patch: you could load it (remember compile it first) into your running lisp image even AFTER all OID instances in your application are created, and you'll get the faster version of OID-NUMBER-LIST then. I hope that helps. Regards, Chun Tian (binghe) |