|
From: sgdailey <sgd...@ro...> - 2004-12-29 23:29:48
|
Thanks to Michael Brown for pointing me in the right direction on the delay I was experiencing in the web page updates. I have modified feed_db.pl a little bit to use memoize to speed up name lookups. Memoize is a Perl module and can be downloaded here. http://perl.plover.com/Memoize/Memoize-1.01.tar.gz Memoize will cache results of a function, next time that function is called it will see if the arguments already have a cached result and if so will simply use the cached results instead of calling the function again. Here are the changes I made to feed_db.pl line 30 or so looks like this: use Socket; just add these next three lines under that line: use Memoize; memoize 'mygethostbyaddr'; sub mygethostbyaddr { gethostbyaddr(@_) }; I haven't tested it extensively yet but I'm hoping it wont continuously look up a host that has probed a thousand ports. I am about to flood the log and see how it handles it. I will post results. Thanks again to Michael Brown sgdailey |