[Top][All Lists]

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

Re: Using __builtin_expect (likely/unlikely macros)

From: Alex Gramiak
Subject: Re: Using __builtin_expect (likely/unlikely macros)
Date: Sun, 14 Apr 2019 21:11:09 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Paul Eggert <address@hidden> writes:

> Alex Gramiak wrote:
>> the likely/unlikely
>> macros are a nice way to indicate that a branch is exceedingly
>> rare/common.
> The cost (in making the C code harder to read, write and maintain) so often
> exceeds that benefit that I'd rather avoid these macros unless there's a good
> performance case for putting them in.

I doubt that any performance benefit would be noticeable, at least
without some microbenchmarks that I don't have.

Though I don't think that these macros, used sparingly around code such
as emacs_abort, would make it harder to read/write/maintain. I'm
certainly not suggesting to throw them around without care.

Still, I understand the resistance to include them. 

reply via email to

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