From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Using __builtin_expect (likely/unlikely macros) Date: Sat, 20 Apr 2019 15:54:23 -0700 Organization: UCLA Computer Science Department Message-ID: <40799fea-4ef7-6a43-f2e6-e9df684b71f2@cs.ucla.edu> References: <87a7gst973.fsf@gmail.com> <875zrgt12q.fsf@gmail.com> <6919a4c8-df76-ea1e-34db-1fa62a360e5a@cs.ucla.edu> <87h8aykdod.fsf@gmail.com> <4fa7885e-8c66-c7c4-ff71-a013505863af@cs.ucla.edu> <2dfb837d-989d-c736-b6e6-b20c0e940596@cs.ucla.edu> <87o956c4n4.fsf@gmail.com> <1fbd2fca-18f0-0a90-7a45-58419a9e11ee@cs.ucla.edu> <1555450070.23658.4@yandex.ru> <66b74701-012a-902e-4a5b-6bc30efa87c0@cs.ucla.edu> <87tveu85xt.fsf@gmail.com> <86ef5wd7az.fsf@gmail.com> <9461246c-409b-15fd-943b-3d673c679870@cs.ucla.edu> <87imv8prov.fsf@telefonica.net> <87zhoko4fg.fsf@telefonica.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="20145"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 21 00:59:10 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hHyww-0005AY-IV for ged-emacs-devel@m.gmane.org; Sun, 21 Apr 2019 00:59:10 +0200 Original-Received: from localhost ([127.0.0.1]:46291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHywv-0006Mo-Kf for ged-emacs-devel@m.gmane.org; Sat, 20 Apr 2019 18:59:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHyuX-0005Lm-BT for emacs-devel@gnu.org; Sat, 20 Apr 2019 18:56:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHysN-00078Y-BK for emacs-devel@gnu.org; Sat, 20 Apr 2019 18:54:28 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:57358) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hHysN-00075A-4U for emacs-devel@gnu.org; Sat, 20 Apr 2019 18:54:27 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 17A61161725 for ; Sat, 20 Apr 2019 15:54:25 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id wPLxWDR873h3 for ; Sat, 20 Apr 2019 15:54:24 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2D17C161810 for ; Sat, 20 Apr 2019 15:54:24 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 4nb-ni1NVk_L for ; Sat, 20 Apr 2019 15:54:24 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id F3CC91616F5 for ; Sat, 20 Apr 2019 15:54:23 -0700 (PDT) In-Reply-To: <87zhoko4fg.fsf@telefonica.net> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235720 Archived-At: =C3=93scar Fuentes wrote: > I'm pretty sure that > the speedup will vanish as code is modified and compilers and CPUs > change. I agree that if you disable GCC optimization or do lots of other=20 plausible-but-low-performance things, that patch will not help performanc= e.=20 However, I'm skeptical that the patch would make performance worse in ord= inary=20 production builds on current Emacs platforms. And I wasn't surprised that= the=20 patch was a significant (albeit small) win on the platform I tested on, b= ecause=20 I looked at the machine code that it generated and I knew something of my= =20 platform's architecture. Of course I could be unpleasantly surprised about how well this performan= ce win=20 generalizes to other platforms - and as I wrote, I am often surprised. To= become=20 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 inte= rpreted=20 that way. My comments were intended only to make it clear that I'm not a = naive=20 programmer.