Threading libsmbclient - a proposal.

Volker Lendecke Volker.Lendecke at SerNet.DE
Sat Apr 4 17:30:29 GMT 2009

On Sat, Apr 04, 2009 at 10:23:26AM -0700, Howard Chu wrote:
> If you're looking at it from a really low-level view (which I guess you 
> are, since you tried cachegrind) then you have to remember that compiler 
> hints like "unlikely" can't help you all that much. The compiler tries to 
> arrange static branch prediction to keep the most-likely path inline, and 
> branch to the less-likely path. But in this case, it still has to branch 
> around the not-taken path, so the compiler hint doesn't help the code 
> density at all.

We'll have to test all this, for sure. In particular with
the DEBUG macro which is a mess with not only one but two if
statements, I think the main effect "unlikely" had was to
move the unlikely branches somewhere else. And using a
function might also help the branch prediction cache as it
will always branch at the same code spot for all the

But again, this is all pure speculation :-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the samba-technical mailing list