bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] unistr/u8-strchr: speed up searching for ASCII characters


From: Pádraig Brady
Subject: Re: [PATCH] unistr/u8-strchr: speed up searching for ASCII characters
Date: Wed, 07 Jul 2010 23:49:14 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 07/07/10 17:07, Simon Josefsson wrote:
> Pádraig Brady <address@hidden> writes:
> 
>> +    /* The following is equivalent to:
>> +         return memmem (s, strlen(s), c, csize);
>> +       but faster for long S with matching UC near the start,
>> +       and also memmem is sometimes buggy and inefficient.  */
>>      switch (u8_uctomb_aux (c, uc, 6))
> 
> Don't we have an efficient memmem in gnulib that this code could use?

Well the current replacement isn't great for small needles.
Also since we don't know the length of the string up front
we would also waste a bit of time on the strlen().

cheers,
Pádraig.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]