Re: memmem small optimalisation

2012-02-24 Thread Joerg Sonnenberger
On Thu, Feb 23, 2012 at 05:34:03PM -0800, Xin Li wrote: > Did you benchmarked the change? Changes like this has to be done very > carefully since it's possible that the extra time spent on addition > and subtractions, when multiple by the length of the "long" string, > may actually defeat the bene

Re: memmem small optimalisation

2012-02-23 Thread Xin Li
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi, On 02/14/12 10:25, Bernard van Gastel wrote: > Hi all, > > I was looking through the sources of memmove at [1], and saw a > (very) small optimization opportunity. The 'memcmp' also compares > the current character, but the current character is

Re: memmem small optimalisation

2012-02-15 Thread Andrey Simonenko
On Tue, Feb 14, 2012 at 07:25:14PM +0100, Bernard van Gastel wrote: > Hi all, > > I was looking through the sources of memmove at [1], and saw a (very) > small optimization opportunity. The 'memcmp' also compares the current > character, but the current character is already checked (first part of

memmem small optimalisation

2012-02-15 Thread Bernard van Gastel
Hi all, I was looking through the sources of memmove at [1], and saw a (very) small optimization opportunity. The 'memcmp' also compares the current character, but the current character is already checked (first part of the condition). As we already know the size of the string is greater as 1 (