[lisp-snmp] Faster ASN encode (reducing memory pressure)
Brought to you by:
binghe
From: John F. <jf...@ms...> - 2009-05-22 09:35:53
|
Dear Chun Tian, Our primary platform is Allegro 8.1, and its garbage collector struggles awfully when garbage is generated. These changes take our time on one benchmark down from more than three minutes to about two minutes, and only about 20% slower than SBCL. Therefore I have modified the ASN encode to reduce the garbage generated. I used a variety of techniques to do it (compiler macro constant folding, value caching, etc.) and modified quite a lot of the code, so I guess you should look it over and give it a good refactoring. In my opinion, the best way forward would be to restructure the whole thing so that the encode functions have a nice scratch buffer and don't need to keep reallocating and copying memory all the time. Simply creating the SNMP message objects takes a lot of time and could be avoided as far as I can see. However, the decode is now the juicier time waster. The weird transitions between stream, lists and vectors make us suffer quite a lot. Again, why not stick with a byte buffer. |