[SCM] Samba Shared Repository - branch master updated

Kai Blin kai at samba.org
Wed May 30 08:41:26 MDT 2012


On 2012-05-30 16:36, Volker Lendecke wrote:
> On Wed, May 30, 2012 at 04:31:43PM +0200, Kai Blin wrote:
>> Does anybody know if the unlikely() condition on the macros has a huge
>> performance impact?
>>
>> if (unlikely(!foo)) {
>> 	return NT_STATUS_NO_MEMORY;
>> }
> 
> In tight loops or core code like talloc it does. The main
> effect I've seen is that the "unlikely" case is moved out of
> the main code path. This leads to less cache footprint.
> That's the main reason why it was put into the DEBUG macros
> once upon a time (not sure it's still in there).
> 
> For relatively rarely executed code I don't think it really
> matters.

Ok, great, so I guess usually I'm fine without this. Thanks for the
explanation.

Cheers,
Kai

-- 
Kai Blin
Worldforge developer http://www.worldforge.org/
Wine developer http://wiki.winehq.org/KaiBlin
Samba team member http://www.samba.org/samba/team/


More information about the samba-technical mailing list