From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Enabling native compilation by default when libgccjit is present Date: Sun, 05 Dec 2021 22:44:32 +0100 Message-ID: References: <83wnkm94oq.fsf@gnu.org> <87y251vdeh.fsf@gnus.org> <87lf11tlzf.fsf@gnus.org> <87r1atrsp9.fsf@gnus.org> <8735n85fa5.fsf@gnus.org> <87r1arskmq.fsf@gnus.org> <87r1arsjpu.fsf@yahoo.com> <87ilw3sjlr.fsf@gnus.org> <87r1ar4mi2.fsf@gmail.com> <874k7nw32n.fsf@gnus.jao.io> <87mtlfasg4.fsf@telefonica.net> <87y24yrgas.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14490"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: =?utf-8?Q?=C3=93scar?= Fuentes , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 05 22:45:53 2021 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 1mtzKR-0003WK-Ga for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Dec 2021 22:45:53 +0100 Original-Received: from localhost ([::1]:46706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtzKQ-0000IE-7q for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Dec 2021 16:45:50 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtzJK-0007wn-6i for emacs-devel@gnu.org; Sun, 05 Dec 2021 16:44:42 -0500 Original-Received: from mail-oln040092075037.outbound.protection.outlook.com ([40.92.75.37]:54081 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtzJE-0004gR-P2 for emacs-devel@gnu.org; Sun, 05 Dec 2021 16:44:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E6M++LEoNBmSE5uEszl5t1Z++2O2plT349p+Ae+zF5Xi/A35VUeZmgJ8iKNi4BqR2hvDCGhaPBcmVlWbYLFzxO6QhdWyT4//nPYqo7ogJqukox+4Ilzdtv17q3hhg8eEN9EvP418fbcR2FWUttGVSNnojFnyo8ihJTA4LnZ4zX2eZ/PTJ0fResl3noOghywC5tiwVe/+gG+dHBLzrL4eBB9nCTjuRZfpaToEY5lRqS9i9wgZFsQEfy4ldcrR6GSmekQZPaDtGLyEVkNs0ySrqRptms/km6nU0e27rMa/lp6Xx8hTEe0rtVx2aY58NMwu9Fi5OTDMhJsdgkqEH5bX7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tQluT8evBf2QF0u3XjKQ3PAiGf6okfCdHI7W9o3NDJI=; b=dU+bd1jN/WumH7oo5R2KAs66Sd4IJrv55xQeL7QzQ1VLSx2ywzCW6zsUvT7C6ht1txlLEKSJyFzEwCNQPTGOUixv35E/5NFgwD3DtuPMEyvYxJGoVPTjsOt5PDMoFlS7X68n1QUqXKKOjvmbsUco3DbPYwS2rCN2zRAp+r1hdcpDuh+9PeDhTqnief5mzF9FUEMCxiHEhdWG+omxA/w+eZF8v6CHs9Bqkz+UVa61wBSOKXMq2IvvNF/U0F/px7Lrv9SWWwqw0ASa9dgGW4MKTKPnfqsCvpf9FSOosu4WCv/erg746nLSzfg7xKAfx/DrUdEiNE8beRX/QJTLBGRELA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tQluT8evBf2QF0u3XjKQ3PAiGf6okfCdHI7W9o3NDJI=; b=GYpUeUCSyz9o+6H8INZLeRJM6a/2ASfEn7N4q3KiekXxdMBkYshyLBq2NH0/beQHL6P+gF1Jz7O92W3XdiVKtEGL/XDZBxguNRjXZPNZ7KxD1LE5AFvIRGQIUkYTtEmIzJronlB8s3K+n7XR5N27N5d+4i+/rorXh09u4DnNXHv5e8Unj6yOK3lxYJxKBWBG4NKLXM6ZSTX1tQf8wpj64PMGBu/01CdJWmGJb93Y+GTrzsLRNg9lnCEOzTP3Q4pejnxWVbVeZtwBbhLw50rujZLNtOyKIhCAnzz7zAZJCmp3zWKJ5Af1IfuKRzOHMDFEw5fNWd9rsOpSraoTQ5ELKg== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM0PR09MB4435.eurprd09.prod.outlook.com (2603:10a6:20b:168::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Sun, 5 Dec 2021 21:44:34 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::b012:5fd9:9447:d64a]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::b012:5fd9:9447:d64a%4]) with mapi id 15.20.4755.021; Sun, 5 Dec 2021 21:44:34 +0000 In-Reply-To: <87y24yrgas.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 05 Dec 2021 20:40:43 +0100") X-TMN: [yIUR1OGeWDJpo/ZuhYUSk7/kk3qv0/ED] X-ClientProxiedBy: GV3P280CA0026.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:b::14) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87r1aqiv5r.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by GV3P280CA0026.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Sun, 5 Dec 2021 21:44:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c099e165-a6c2-4ca1-5391-08d9b8386d74 X-MS-TrafficTypeDiagnostic: AM0PR09MB4435: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S+1DX4XzQ8WQ2dAItQeXfsmTVIRiZwsI7fxtr2wdmHFQiMLa9ng/o0470CZHXJsrKd6Rbd8K21V7BxAHLUisO7BbhUaN7rxqM6hCM/KFjRoIU3FRHCZyqWmOGZTgnsjn2Qqt9AR7ffhiol5l+H4OXaumKabu4c8QgNfLhelczURggQptmN7fwWudbT+F4tHK4oCFtFSWb5OrTIL4y1uUUnmsiEsfIgvt2oqa09v2+4M3xQdoArlDDbYCQpUJr/MaTGDAPjZg5rHIUvlKzf6LVIpRS5bXR2aG6Aa5O6QDqmVUk8nxjsX4tF1n3tV0Ya5BTHcwJJiWnVV7K/yuSyGuSpEa32HMVuonW8tHdmXyT7ehU+5hwMXBS+8F8Gu91M9seNNFJJQhp+mCMn/F8T2Ec9kCMkSRisczyKvagiI9ulAWNpBhx35rVOypLIhvp1hr/vS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UdRVnQ5ZDNManRsa1BTTU84en X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-64da6.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: c099e165-a6c2-4ca1-5391-08d9b8386d74 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2021 21:44:34.6916 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR09MB4435 Received-SPF: pass client-ip=40.92.75.37; envelope-from=arthur.miller@live.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:281029 Archived-At: Lars Ingebrigtsen writes: > =C3=93scar Fuentes writes: > >>> I'd be curious to know where people are seeing speedups. >> >> In my experience nativecomp is somewhat noticeable while using lsp-mode. >> >> Otherwise, not much, if at all. > > In some micro-benchmarks, I see significant speedups. Let's see... > what did I test last... > > Right: > > --- > ;; (benchmark-run 1000 (benchy)) > > (defun benchy () > (let ((syms 0)) > (mapatoms (lambda (sym) > (setq syms (+ syms (length (symbol-name sym))))) > obarray) > syms)) > --- > > This is 50% faster with nativecomp than without. > > It's easy to be fooled when trying to benchmark, since an "emacs -Q" > doesn't native-comp the bits you're trying to benchmark, necessarily. > (Unless you've done a full AOT build, which most people don't.) > > But still, even when that's done correctly, the nativecomp speedups are > pretty elusive in real world code. For instance, I'd expect shr > rendering to be significantly speeded up when doing table-based layouts, > because it's doing a lot of... stuff. But: > > (benchmark-run 10 (eww-open-file "/tmp/foo.html")) > > stubbornly takes the same amount of time with or without nativecomp, > and it's the same way with every real bit of code I've tested (like byte > compilation, which I'd also expect to be faster with nativecomp). > > So I don't know whether something is defeating nativecomp things in more > complex situations. Have you tried speed 3 with native comp? >> The reason for this is not hard to understand for anyone with a little >> bit of knowledge about binary code optimization. For instance, if your >> Elisp code consists on invoking opaque C primitives, the gain of >> compiling it to machine instructions will be mostly irrelevant. > > My micro-benchmark up there is almost all opaque C primitives, but is > helped a lot. If I remember old days before native-comp, anonymous lambads were not byte-compiled? I maybe missunderstand, but that means the above lambda is running interpretted without native comp, but with native comp it gets comp= iled (update 8: https://akrl.sdf.org/gccemacs.html#orga9203de) and update 9 talk= es something about lambda performance. I am not sure that kicks in to be hones= t, maybe I missunderstand. After second thought I also think that Helm is getting help a lot by lambda performance, which might explain why Emacs feels snappier in my case.