httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Lewis <...@joe-lewis.com>
Subject Re: splitting a string...
Date Tue, 02 Jan 2007 15:52:31 GMT
Drew Bertola wrote:
>>   
>>     
>>>          while ( i < len )
>>>            {
>>>              ap_fputc(f->next, ctx->bb, str[i++]);
>>>            }
>>>     
>>>       
>> This is a performance hog.
>>   
>>     
>
> With this, I don't have the segfaults anymore.
>
> html is ok too.
>
> --
> Drew
>   
I would expect it to be a performance hog.  You are playing with 
creating a good number of individual buckets.

Make SURE you are not using things like strcasestr - it is not platform 
independent (requires GNU source definitions).  Besides, you may want to 
change that to a series of apr_strmatch_precompile and apr_strmatch 
commands to do the searching - those take an additional parameter for 
the length of the bucket, and give you another added precaution against 
the dreaded NULL-termination issues across platforms and other modules.  
Joe Orton helped me a great deal when I started finding problems that I 
thought were PHP bugs, but really allowed me to adapt for any lazy 
module that gets written.

If this information is not enough to help, let me know, and I will rip a 
lot of the code out of my template wrapper and shoot that to you (and 
hope it works in that state - I won't be doing the "checks" on it).

Joe

Mime
View raw message