[lisp-snmp] Weak hashtables for OIDs
Brought to you by:
binghe
From: John F. <jf...@ms...> - 2009-05-12 05:31:18
|
Dear Chun Tian, "Chun Tian (binghe)" <bin...@gm...> writes: > 在 2009-5-11,10:42, John Fremlin 写道: [...] >> "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. I tried this idea out. It seems it saved about 10% of memory on Allegro, but did not make any difference to the speed of our (rather bad) benchmark. Maybe it will help, maybe not ;-) Anyway, here is the patch to use trivial-garbage which has portable weak hashtables. (It also fixes some wrong references to #+asn.1-yacc instead of #+asn.1-features:cl-yacc) |