httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject Re: Killer malloc() in apr_sendv()
Date Fri, 17 Aug 2001 21:51:20 GMT

> In a message dated 01-08-17 16:02:41 EDT, you write:
> 
> > > I know the conventional wisdom is that SSI is slow because of
> >  > the malloc calls in bucket creation, but the problem might
> >  > be elsewhere.  I've tried adding in a free list of recycled
> >  > buckets, to reduce the calls to malloc, but it didn't seem to
> >  > affect performance measurably.
> >  
> >  I've replaced the malloc/frees in the bucket code on Windows with a power 
> of 
> > 2 allocator
> >  and it makes a BIG difference in performance. I expect the same on every 
> OS 
> > with the
> >  exception of Linux.
> 
> You might want to add the same 'power of 2' stuff to a call 
> that is absolutely killing the windows version.
> 
> apr_sendv() in /srclib/apr/network_io/win32/sendrecv.c
> is using a malloc()/free() combo for only 8 bytes!
> It's using WSASend() and can 'scatter gather' but so far
> I've never seen more than 2 separate buffers to 'gather'
> on any particular call to apr_sendv().
> 
> There is a comment there about 'putting it on the stack' but
> you'd be better off doing this sooner than later because
> the malloc()/free() for only 8 bytes is killing you on every
> transmit.
> 

I'll do it this weekend. 
Thanks,

Bill


Mime
View raw message