[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master b0ba0d42b0f: * src/lisp.h (EQ): Improve generated code.
From: |
Mattias Engdegård |
Subject: |
Re: master b0ba0d42b0f: * src/lisp.h (EQ): Improve generated code. |
Date: |
Thu, 28 Nov 2024 18:53:46 +0100 |
28 nov. 2024 kl. 14.53 skrev Pip Cet via Emacs development discussions.
<emacs-devel@gnu.org>:
> Maybe we should use __builtin_expect_with_probability instead, in those rare
> cases when we are certain we're making a correct prediction? Or, my
> preference, avoid using __builtin_expect entirely, so our scarce resources
> can be spent on more important issues?
Actually __builtin_expect can definitely provide a measurable performance
improvement, mainly for BB ordering and cold-path moving as suggested by
Andrea's commit note. I've been thinking about using it in other cases.
We should probably define some variant of likely/unlikely because those cover
most needs of __builtin_expect, rather than using it directly. Then portability
wouldn't be a problem.
> I also don't think the assumption you're telling GCC to make in this specific
> case (more than 90% of calls to EQ happen while syms_with_pos_enabled ==
> false) is obviously correct.
On this point I agree -- this particular change may have been made in haste,
although I applaud the spirit.