emacs-devel
[Top][All Lists]
Advanced

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

Re: Using __builtin_expect (likely/unlikely macros)


From: Konstantin Kharlamov
Subject: Re: Using __builtin_expect (likely/unlikely macros)
Date: Fri, 19 Apr 2019 16:58:01 +0300



On Пт, Apr 19, 2019 at 07:45, Alex Gramiak <address@hidden> wrote:
Paul Eggert <address@hidden> writes:

 Konstantin Kharlamov wrote:
I was told that e.g. "cold" attribute can sometimes produce unbearably slow
 code https://gcc.gnu.org/ml/gcc-help/2019-01/msg00035.html

Although cold functions can be slow, it appears that overall it's a win for Emacs to mark _Noreturn error function declarations as cold: on my platform, 'make compile-always' ran about 1.3% faster. So I installed the attached patch
 into master.

Thanks. What do you think about marking a few bytecode cases as
cold/unused? I've attached a diff below that does that. Does it make a
difference for you on your setup? It seems to slow Emacs down a slight
bit for me, but I was hoping you might know why it would do so. Since
the newly cold attributes should be unused, is this perhaps a GCC bug?

The slowdown is to be expected, given that GCC devs said that "cold" produces very inefficient code.

It worked in Paul's case because he marked as "cold" functions that never return.





reply via email to

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