[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: |
Fri, 19 Apr 2019 07:45:18 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
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?
> This patch also adds a convenience macro AVOID for the now-common pattern
> '_Noreturn ATTRIBUTE_COLD void'.
I'm not sure about the name. If I wasn't part of this discussion I might
have thought AVOID meant that one should avoid usage of the procedure in
new code. Not a big deal, of course.
cold.diff
Description: cold attributes
- Re: Using __builtin_expect (likely/unlikely macros), (continued)
- Re: Using __builtin_expect (likely/unlikely macros), Alex Gramiak, 2019/04/16
- Re: Using __builtin_expect (likely/unlikely macros), Alex Gramiak, 2019/04/16
- Re: Using __builtin_expect (likely/unlikely macros), Stefan Monnier, 2019/04/16
- Re: Using __builtin_expect (likely/unlikely macros), Konstantin Kharlamov, 2019/04/16
- Re: Using __builtin_expect (likely/unlikely macros), Paul Eggert, 2019/04/18
- Re: Using __builtin_expect (likely/unlikely macros), Konstantin Kharlamov, 2019/04/18
- Re: Using __builtin_expect (likely/unlikely macros), Andy Moreton, 2019/04/18
- Re: Using __builtin_expect (likely/unlikely macros), Paul Eggert, 2019/04/18
- Re: Using __builtin_expect (likely/unlikely macros), Andy Moreton, 2019/04/18
- Re: Using __builtin_expect (likely/unlikely macros), Paul Eggert, 2019/04/18
- Re: Using __builtin_expect (likely/unlikely macros),
Alex Gramiak <=
- Re: Using __builtin_expect (likely/unlikely macros), Konstantin Kharlamov, 2019/04/19
- Re: Using __builtin_expect (likely/unlikely macros), Alex Gramiak, 2019/04/19
- Re: Using __builtin_expect (likely/unlikely macros), Paul Eggert, 2019/04/19
- Re: Using __builtin_expect (likely/unlikely macros), Alex Gramiak, 2019/04/19
- Re: Using __builtin_expect (likely/unlikely macros), Alan Mackenzie, 2019/04/19
- Re: Using __builtin_expect (likely/unlikely macros), Paul Eggert, 2019/04/19
- Re: Using __builtin_expect (likely/unlikely macros), Alan Mackenzie, 2019/04/20
- Re: Using __builtin_expect (likely/unlikely macros), Andy Moreton, 2019/04/20
- Re: Using __builtin_expect (likely/unlikely macros), Paul Eggert, 2019/04/20
- Re: Using __builtin_expect (likely/unlikely macros), Eli Zaretskii, 2019/04/20