httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Behlendorf <br...@hyperreal.org>
Subject Re: cvs commit: apache-1.3/src/modules/standard mod_log_referer.c
Date Thu, 21 May 1998 18:38:00 GMT
At 06:11 PM 5/21/98 +0100, you wrote:
>brian@hyperreal.org wrote:
>>   -        ap_str_tolower(referer);
>>   +        referertest = ap_pstrdup(orig->pool, referer);
>>   +        ap_str_tolower(referertest);
>
>Where these things are for local use only, wouldn't it be better (i.e.
>more efficient) to use alloca?
>
>	referertest=alloca(strlen(referer)+1);
>	strcpy(referertest,referer);
>	ap_str_tolower(refertest);

I thought since our pool mechanisms asks the OS for memory in specific
sized chunks (4K?) and hands that out in chunks as needed, that it's better
to deal with this allocation in userland than in the kernel (less chance of
using a 4K page for 80 bytes of characters, etc?)  That's a stretch for me,
though, I could be wrong.  Didn't Dean or someone do some performance #'s?

	Brian


--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
pure chewing satisfaction                                  brian@apache.org
                                                        brian@hyperreal.org

Mime
View raw message