[Top][All Lists]

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

Re: Using __builtin_expect (likely/unlikely macros)

From: Óscar Fuentes
Subject: Re: Using __builtin_expect (likely/unlikely macros)
Date: Sat, 20 Apr 2019 18:28:00 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Paul Eggert <address@hidden> writes:

> I like to see significant benefits for performance-related changes
> where the effects are not obvious. For improvements where the
> generated code is "obviously" faster (fewer and simpler instructions,
> say), I typically don't bother with measurements as my own time is
> limited too.

You will be surprised.

Modern hardware is complex.

> Agreed that 1.3% is no big deal by itself, but if one can make a
> series of 1.3% performance improvements that build on each other,
> their effects multiply and the overall effort has worthwhile practical
> benefits.

If the 1.3% improvement in performance requires non-minimal source code
complexity growth, IMHO it is not worhwile, at least on Emacs' case.

Another problem with this type of hacks is that they tend to dilute over
time, because compilers/architectures evolve. And because people change
the code without testing that those pesky declarations end in the right
place; it becomes a kind of cargo-cult.

reply via email to

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