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.