[Bro] cf.c speedup patch

Mark Dedlow mtdedlow at lbl.gov
Fri Dec 16 09:46:24 PST 2005

This simple patch speeds up the cf program by 2-3 times (on my system)
for the typical log file I process, esp. conn logs.

It's based on the observation that the integer part of the unix
time typically repeats frequently (ie, the are many connections
per second) so it caches the time from one line to next, and only
bothers calling localtime() and strftime() if the time is different
than on the last line.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cf.c.diff
Url: http://mailman.ICSI.Berkeley.EDU/pipermail/bro/attachments/20051216/5523f5b3/attachment.ksh 

More information about the Bro mailing list