From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.devel Subject: Re: Using __builtin_expect (likely/unlikely macros) Date: Fri, 19 Apr 2019 16:58:01 +0300 Message-ID: <1555682281.12550.3@yandex.ru> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-5; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="6688"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Paul Eggert , Stefan Monnier , emacs-devel@gnu.org To: Alex Gramiak Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 19 16:05:24 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 1hHU8q-0001PX-61 for ged-emacs-devel@m.gmane.org; Fri, 19 Apr 2019 16:05:24 +0200 Original-Received: from localhost ([127.0.0.1]:56949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHU8o-0003mT-Sr for ged-emacs-devel@m.gmane.org; Fri, 19 Apr 2019 10:05:22 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55602) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHU7b-0003ld-Sc for emacs-devel@gnu.org; Fri, 19 Apr 2019 10:04:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHU37-0004LL-Bo for emacs-devel@gnu.org; Fri, 19 Apr 2019 09:59:30 -0400 Original-Received: from forward106j.mail.yandex.net ([2a02:6b8:0:801:2::109]:42249) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hHU37-0004Eb-51 for emacs-devel@gnu.org; Fri, 19 Apr 2019 09:59:29 -0400 Original-Received: from mxback12o.mail.yandex.net (mxback12o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::63]) by forward106j.mail.yandex.net (Yandex) with ESMTP id EE8B711A1962; Fri, 19 Apr 2019 16:59:24 +0300 (MSK) Original-Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback12o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id o5KMDGZkZF-xOPuoHAE; Fri, 19 Apr 2019 16:59:24 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1555682364; bh=kVJuWSRmfB/b85dJ+Cr6xkYd68umEn1rYpQBGpXNhG0=; h=In-Reply-To:Cc:To:Subject:From:References:Date:Message-Id; b=pF6491vmvaMIhdAPY7EGpX5FI0DRVDVc1617GBzHEbXJhVlMnZ4+/rMQRk+s2ow0n pjumL6RBgb+ERIOAMQbewHvnGpE1rYPBZ9plDaaKsL+9PMHVvst3eXfgX7qjz3TuTs YKdX9eojy8208nBx7HX3ZAbmn22knATut+Ryy6O8= Authentication-Results: mxback12o.mail.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id dTvfcITa9e-xNSWju36; Fri, 19 Apr 2019 16:59:23 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) In-Reply-To: <87tveu85xt.fsf@gmail.com> X-Mailer: geary/mainline~g7970b668 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a02:6b8:0:801:2::109 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:235658 Archived-At: On =BF=E2, Apr 19, 2019 at 07:45, Alex Gramiak wrote: > Paul Eggert writes: >=20 >> Konstantin Kharlamov wrote: >>> I was told that e.g. "cold" attribute can sometimes produce=20 >>> unbearably slow >>> code https://gcc.gnu.org/ml/gcc-help/2019-01/msg00035.html >>=20 >> Although cold functions can be slow, it appears that overall it's a=20 >> win for >> Emacs to mark _Noreturn error function declarations as cold: on my=20 >> platform, >> 'make compile-always' ran about 1.3% faster. So I installed the=20 >> attached patch >> into master. >=20 > 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? The slowdown is to be expected, given that GCC devs said that "cold"=20 produces very inefficient code. It worked in Paul's case because he marked as "cold" functions that=20 never return. =