[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: Sat, 20 Apr 2019 15:54:23 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Óscar Fuentes wrote:
I'm pretty sure that
the speedup will vanish as code is modified and compilers and CPUs

I agree that if you disable GCC optimization or do lots of other plausible-but-low-performance things, that patch will not help performance. However, I'm skeptical that the patch would make performance worse in ordinary production builds on current Emacs platforms. And I wasn't surprised that the patch was a significant (albeit small) win on the platform I tested on, because I looked at the machine code that it generated and I knew something of my platform's architecture.

Of course I could be unpleasantly surprised about how well this performance win generalizes to other platforms - and as I wrote, I am often surprised. To become surprised, though, we need to see some numbers.

I'm far from being a naive programmer.

I didn't think you were naive, and apologize if my comments could be interpreted that way. My comments were intended only to make it clear that I'm not a naive programmer.

reply via email to

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