[Top][All Lists]

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

Re: Using __builtin_expect (likely/unlikely macros)

From: Paul Eggert
Subject: Re: Using __builtin_expect (likely/unlikely macros)
Date: Mon, 15 Apr 2019 20:42:56 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Alex Gramiak wrote:
These macro calls would not help near calls to emacs_abort, as it should already
be obvious to a careful human reader that the jump to emacs_abort is the road
less traveled. (That's also obvious to GCC, since emacs_abort is _Noreturn.)

To human readers, yes, but from what I can tell, GCC is mixed on this.

Then we should fix GCC, if the code it generates has a performance problem (whatever it is, it's quite small). That'd be better than littering the Emacs source code with __builtin_expect or UNLIKELY calls. The GCC manual recommends against manually inserting such calls; performance nerds are supposed to use -fprofile-arcs instead. In my experience the calls are typically more trouble than they're worth.

reply via email to

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