Re: mempools conversions, more ..

From: Adrian Chadd <adrian@dont-contact.us>
Date: Mon, 9 Oct 2000 15:46:22 +0800

On Mon, Oct 09, 2000, Andres Kroonmaa wrote:
> On 8 Oct 2000, at 13:41, Adrian Chadd <adrian@creative.net.au> wrote:
>
> > On Sat, Oct 07, 2000, Andres Kroonmaa wrote:
> > >
> > > How can you make modules in lib/ to use memPools?
> >
> > uhm, heh. Good question. :-) At this stage I would say "make the mempools
> > code part of lib/" since I actually believe it should be sitting there.
>
> hmm, I'm afraid its too much integrated with src tree. My first thought was
> to move some stuff from lib into src (head.c and Array.c) just for the sake
> of using mempools.
>
> > Why? Found some evil hackery in lib/ that could do with a mempool treatment?
>
> httpHeaderAddEntry uses arrayAppend directly and seems to be one of the
> main reasons for high malloc rate of very small sizes.
> After I thought I have moved most malloc hogs on pools, this seems to be the
> next top priority area.
> Also, several places use stackPush/Pop that is defined to point at arrayAppend
> too (Stack.h). These seems to also cause quite alloc/rate with small sizes.
> Therefore we want to put these on mempools.
> I wonder if we can hack them cleanly under lib/ and make them use mempools
> under src/ ?

I still think the right way to go is to move the mempools code out into
lib/ . It doesn't require anything in src/ besides stuff to shovel out
statistics, right? So, in that case, lib/mempools.c has the memory pool
code, and src/mempools.c has the statistics reporting code.

I'm for moving stuff *out* of src/ into lib/, because a lot of stuff in
src/ could be reused by other network appliances (the network IO code,
the disk IO code, the event loop stuff, the DNS code, etc..). Not that
I am going to do THAT any time soon, but its just something in the back
of my head.

If you can look at moving MemPools into lib/ (and leave the mem.c and
the statistics stuff in MemPools.c alone) I'll look at committing it.

Also, please throw me any patches you have to convert structures to Mempools.
I'm about to commit (some) of the TLV stuff converted, but I'd appreciate
any more you have.

Adrian

-- 
Adrian Chadd			"If a butterfly flaps its wings in China,
<adrian@creative.net.au>	    will a woman get naked in Amsterdam?"
				      -- Ashley Penney on Chaos Theory
Received on Mon Oct 09 2000 - 01:46:30 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:41 MST