unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Björn Lindqvist" <bjourne@gmail.com>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>
Cc: Pip Cet <pipcet@protonmail.com>,
	Andrea Corallo <acorallo@gnu.org>,
	 Emacs Devel <emacs-devel@gnu.org>
Subject: Re: master b0ba0d42b0f: * src/lisp.h (EQ): Improve generated code.
Date: Fri, 29 Nov 2024 02:10:37 +0100	[thread overview]
Message-ID: <CALG+76ccn7PRMu1d5-cqbOcUpWiBF7=vrkdALzegGmXmSdxkDQ@mail.gmail.com> (raw)
In-Reply-To: <8BCABD6D-6605-438C-A62D-B7DA42D07AD4@gmail.com>

Den tors 28 nov. 2024 kl 18:54 skrev Mattias Engdegård
<mattias.engdegard@gmail.com>:
>
> 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.

It can also worsen performance if one is not careful. Micro
optimization is very often very counter-intuitive so relying on
theoretical improvements is often not advisable. Especially not for
code that should run efficiently on dozens of different platforms
years into the future.


-- 
mvh/best regards Björn Lindqvist



      parent reply	other threads:[~2024-11-29  1:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <173279015204.1017853.4020802222494409378@vcs3.savannah.gnu.org>
     [not found] ` <20241128103552.86CC34F4FDB@vcs3.savannah.gnu.org>
2024-11-28 13:53   ` master b0ba0d42b0f: * src/lisp.h (EQ): Improve generated code Pip Cet via Emacs development discussions.
2024-11-28 14:44     ` Eli Zaretskii
2024-11-28 14:55       ` Andrea Corallo
2024-11-28 15:00         ` Eli Zaretskii
2024-11-28 15:02     ` Andrea Corallo
2024-11-28 17:53     ` Mattias Engdegård
2024-11-28 20:14       ` Pip Cet via Emacs development discussions.
2024-11-28 20:16       ` Eli Zaretskii
2024-11-28 22:46         ` Stefan Kangas
2024-11-29  8:21           ` Andrea Corallo
2024-11-29  1:10       ` Björn Lindqvist [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALG+76ccn7PRMu1d5-cqbOcUpWiBF7=vrkdALzegGmXmSdxkDQ@mail.gmail.com' \
    --to=bjourne@gmail.com \
    --cc=acorallo@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mattias.engdegard@gmail.com \
    --cc=pipcet@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).