From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: Inlining policy Date: Wed, 08 Apr 2020 18:28:36 +0000 Message-ID: References: <86tv2h2vww.fsf@gmail.com> <86d08y4zsx.fsf@gmail.com> <83sghs7qdz.fsf@gnu.org> <83h7y63sjj.fsf@gnu.org> <834ku43c61.fsf@gnu.org> <83k12zz6ds.fsf@gnu.org> <054393f3-3873-ab6e-b325-0eca354d8838@gmx.at> <29a6c120-f260-0ea3-f5e0-1d3dd6323d09@gmx.at> <5752c978-3a13-4e09-18b3-14201eaf1083@gmx.at> <2818498c-24f9-0873-80d7-afd7899b68ac@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="68006"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: Stefan Monnier , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 08 20:29:34 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMFS9-000HZM-3u for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Apr 2020 20:29:33 +0200 Original-Received: from localhost ([::1]:39484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMFS7-0005cQ-O5 for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Apr 2020 14:29:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57383) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMFRV-0005DS-CB for emacs-devel@gnu.org; Wed, 08 Apr 2020 14:28:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMFRU-0008Bh-5e for emacs-devel@gnu.org; Wed, 08 Apr 2020 14:28:53 -0400 Original-Received: from mx.sdf.org ([205.166.94.20]:63587) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jMFRT-00088e-VT for emacs-devel@gnu.org; Wed, 08 Apr 2020 14:28:52 -0400 Original-Received: from sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 038ISaGN019329 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Wed, 8 Apr 2020 18:28:37 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 038ISaIo018476; Wed, 8 Apr 2020 18:28:36 GMT In-Reply-To: <2818498c-24f9-0873-80d7-afd7899b68ac@cs.ucla.edu> (Paul Eggert's message of "Tue, 7 Apr 2020 21:03:08 -0700") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 205.166.94.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:246685 Archived-At: Paul Eggert writes: > On 4/5/20 3:23 AM, Andrea Corallo wrote: >> what about having a new macro to control the key operations we want to >> always have inlined at -O0 and -Og instead of falling back into defining >> these as macros? > > I looked into this some more, and found some problems with using > __attribute__((always_inline)), such as GCC complaining that it can't > inline some functions in some cases on some platforms. It was a pain > to suss out what would improve performance while avoiding the > warnings, and while fiddling with this a bit I found a simpler change > that had even better performance than __attribute__((always_inline)) > did, at least on one platform for my standard benchmark of 'make > compile-always'. So I installed the two attached patches > instead. Together they improve Emacs CPU performance for 'gcc -Og' by > about 60% on my benchmark. Is this a problem you have experienced compiling one of our builds or something you have found can potentially happen in general? Anyway should be easy to ask GCC to silence the specific warning in case. > Thanks for suggesting inlining as a way to improve Emacs performance > when compiled with -Og. Welcome Andrea -- akrl@sdf.org