From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Enabling native compilation by default when libgccjit is present Date: Sun, 05 Dec 2021 20:40:43 +0100 Message-ID: <87y24yrgas.fsf@gnus.org> 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> 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="31197"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: =?utf-8?Q?=C3=93scar?= Fuentes Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 05 20:42:22 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 1mtxOv-0007uX-Jr for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Dec 2021 20:42:21 +0100 Original-Received: from localhost ([::1]:50270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtxOu-00081p-0g for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Dec 2021 14:42:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtxNY-0007DK-Fr for emacs-devel@gnu.org; Sun, 05 Dec 2021 14:40:56 -0500 Original-Received: from [2a01:4f9:2b:f0f::2] (port=44838 helo=quimby.gnus.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtxNS-0000Ga-OZ for emacs-devel@gnu.org; Sun, 05 Dec 2021 14:40:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=zhsICnggi8VfLAXrA084s5EOAFUt1S5NoifKeaB/hV0=; b=dkuCoGzsDT20aOiErmbmeTecw7 OmNpQwZ9FOL1MnpfCfYvqcTYxI2f3ZCc6YYt2iXIrFnJJ83ffEqXnRCFiGhikyusKBGiqa/kRMUcC sVWg6kyLMo0qWJX9IljYcGJ9gafMQf4oEC6slYy6QFHdxdeN5UL1whIOecibHt0ykmrY=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mtxNM-0002GD-AE; Sun, 05 Dec 2021 20:40:47 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEWvPDZcRDIRCwrX son///9/75/RAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+UMBRMYA30B6WgAAAHDSURBVDjLjZPrsesg DIQFNICgAYQbMFb/vd1d+ZE4c35cJhPb+mD1RKTK5BLJ83sJFh5pnM8voNhqU2oe0l4gJ51CoZHe JzLVMo9JektRPfPvB8BaqSOi+gJDIiKZbzvCEeH29DZHXvzpr33CIxLQNv8Af6+fQnyBOa39L6gX 0PomVR+ALfbYzdsJLE/f2iePzaNjYuNQL2t9lLzRq2jX6r6nx4/u8S+pVlX3eWtZ05q0ddG8Lfc1 1wO6u+cuzQde1I4b4DikizQbvruPfIPdY2E0NoeWTZPTjV/AjZp7Q3waldZCexHdKLrmhniNel2p 4MIXRxU6i0KxfpxSeOkE0XTWtRvtS+B78wNRsr293eAg2HFgIN/SCrLZ5ALYgM9htSAt5D8CzAAQ 0KgEtxhj8iZmiBVf7fQJ7+VyrosZJNN+gXEDY6BqZXndU/SWpbiAqTkSTVSNGiUCSs0ACtCMHVWO /wWg3Q9rbQBU3OVwYVHu1bFNLfnSLvPuNhusUxO87ZgFoSjtrbLVk03pyxTOr9HtiAXFJdiy4Z7d w9kjOxQZWpyg53qUM21akVlt3+CI6QkgHxBtjCg0HH1uWr9mkXaAf5OiilE4aSzrAAAAJXRFWHRk YXRlOmNyZWF0ZQAyMDIxLTEyLTA1VDE5OjI0OjAzKzAwOjAwCssKKwAAACV0RVh0ZGF0ZTptb2Rp ZnkAMjAyMS0xMi0wNVQxOToyNDowMyswMDowMHuWspcAAAAASUVORK5CYII= X-Now-Playing: The Police's _Outlandos d'Amour_: "Born in the 50's" In-Reply-To: <87mtlfasg4.fsf@telefonica.net> (=?utf-8?Q?=22=C3=93scar?= Fuentes"'s message of "Sun, 05 Dec 2021 18:10:19 +0100") X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a01:4f9:2b:f0f::2 (failed) Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 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, RCVD_IN_DNSWL_MED=-2.3, RDNS_NONE=0.793, SPF_HELO_NONE=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:281018 Archived-At: =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. > 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. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no