bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] (x)memcoll: performance improvement when input is known to b


From: Pádraig Brady
Subject: Re: [PATCH] (x)memcoll: performance improvement when input is known to be NUL delimited.
Date: Thu, 11 Mar 2010 12:14:50 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 10/03/10 07:05, Chen Guo wrote:
Hi Bruno,
I tried with the checks for the presence of that last NUL byte like you 
suggested,
> and to my surprise on the remote machine I was testing on it was consistently
> (as in every run for 20 runs) faster, and thus I've included it in the patch.
> This is not what I expected at all

How much faster?
Could it be due to cache prefetching?
I would try different sized strings to test (32,65,1025,...)

Also I think that when you do
   if (!something)
gcc will do
   if (__unlikely(!something))
http://www.pixelbeat.org/programming/gcc/c_c++_notes.html#branch_predict

cheers,
Pádraig.




reply via email to

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