httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <>
Subject Re: cvs commit: httpd-2.0/server core.c
Date Fri, 19 Oct 2001 16:27:54 GMT
On Fri, 19 Oct 2001, Aaron Bannert wrote:

> > Changing pcalloc to palloc should only be done when we have specific
> > information that it is *really* helpful.
> I agree that in general we probably don't want to go around replacing
> these things everywhere, but in some cases (like inside a tight loop
> in a filter that gets called many times during a single request) it may
> make sense. But that's why we have two ways to allocate memory, right?

Yep.  The buckets code was a good example of this... someone (Brian? Ian?)
did some profiling a while back, and at that time, the callocs in the
buckets code were way up there on the performance-suck-o-meter for no good
reason at all.  All of the fields were already being explitly set to their
right values anyway, so the calloc wasted tons of cycles.  The flip side,
of course, is that that part of the buckets code is very straightforward,
so it was obvious that the s/calloc/malloc/g changes were correct.


   Cliff Woolley
   Charlottesville, VA

View raw message