[Snort-devel] I think I got it

tlewis at ...255... tlewis at ...255...
Mon Jul 30 23:52:36 EDT 2001


On Mon, 30 Jul 2001, Phil Wood wrote:

> I believe that you could get away with creating the necessary storage
> either statically, or when called as local arrays.  I would pick which
> ever method caused the least number of cycles.  I like static, cause
> memory is cheap and you formalize the use and can't interfer with other
> routines.  I think that would cut down on alot of malloc / free subroutine
> calls.

I disagree; statics lead to non-thread-safe code.  It's cycles that
are free on today's memory-latency-constrained systems, and trading more
computation for less memory access and paying attention to memory topology
(can my structures fit in a single cache line?  do they?)  will pay many
more dividends than trying to cut back artiicially on number allocations.

Of course, the huge speedups to be had are in packet acquisition, not
in matching and processing, but no one seems interested in working on
that area...

--
Todd Lewis
tlewis at ...255...





More information about the Snort-devel mailing list