Re: [lisp-snmp] Misc fiddles for new OID types
Brought to you by:
binghe
From: Chun T. (binghe) <bin...@gm...> - 2009-05-11 02:54:43
|
在 2009-5-11,10:42, John Fremlin 写道: > Dear Chun Tian, > > "Chun Tian (binghe)" <bin...@gm...> writes: > [...] >> Using a "weak hash table" as a cache for holding SIMPLE-OID instances >> which already created in current lisp image, so that few SIMPLE-OID >> created when repeat do SNMP-WALK on same MIB node. The key of this >> hash table would be a "oid number list" as a list, and the value >> would >> be the correspond SIMPLE-OID instance. >> >> Since "weak hash table" is not in CL standard, I'll support only a >> few >> implementations included at least LispWorks, AllegroCL and SBCL, and >> make a new "ASN.1 feature" (OID-CACHE) for this work. Do you think >> this features would be useful for you? > > I think this might be a bad idea and probably will decrease > performance > on our workload, as we have many OIDs that are never seen again, so > putting them into a weak hash-table just causes more problems for the > garbage collector (they are difficult to implement efficiently). OK ... so you don't need it in case you have so many one-time OIDs. > > > As I said before, the most sensible thing is probably just to use > simple > vectors as OIDs. I think this change wouldn't bring any essential performance boost from the view of algorithm, right? A simple vector is "fast" than A list only when we need to access specific elements in it. For simple vectors, we have O(1) performance here (and O(n) for lists). But you should see, in ASN.1 package, any time we need this vector/list, we need all elements from it. Here we just waste some memory (which equals to the number of SIMPLE-OID instances times a small factor), compare to the whole memory requirements it's nothing. Comments? --binghe > > > [...] > |