From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: On elisp running native Date: Sun, 01 Dec 2019 10:34:06 +0000 Message-ID: References: <83zhgeoh0k.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="15371"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (berkeley-unix) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 01 11:35:25 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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ibMZZ-0003qW-Hm for ged-emacs-devel@m.gmane.org; Sun, 01 Dec 2019 11:35:25 +0100 Original-Received: from localhost ([::1]:49820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ibMZY-0002v1-AZ for ged-emacs-devel@m.gmane.org; Sun, 01 Dec 2019 05:35:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32922) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ibMYR-00020E-H4 for emacs-devel@gnu.org; Sun, 01 Dec 2019 05:34:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ibMYP-0007Ki-W4 for emacs-devel@gnu.org; Sun, 01 Dec 2019 05:34:15 -0500 Original-Received: from mx.sdf.org ([205.166.94.20]:61567) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ibMYP-0007JV-K6; Sun, 01 Dec 2019 05:34:13 -0500 Original-Received: from sdf.org (IDENT:akrl@sverige.freeshell.org [205.166.94.5]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id xB1AY68C006956 (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits) verified NO); Sun, 1 Dec 2019 10:34:06 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id xB1AY6dm004888; Sun, 1 Dec 2019 10:34:06 GMT In-Reply-To: (Stefan Monnier's message of "Fri, 29 Nov 2019 10:30:33 -0500") 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:242950 Archived-At: Stefan Monnier writes: > I'm not sure what those 11s-12s come from, but I think it's safe to take > the "1.9x" as the more relevant measure in terms of measuring the impact > of native compilation on the speed of bytecomp.el. I've got some time to repeat the measure trying to understand better what's going on. I've repeated the same test but running it 10 times. (benchmark 10 '(mapc #'byte-compile-file (directory-files "~/emacs/lisp" t "el$"))) I've discovered that my previous measure made not much sense because the time spent into GC is much bigger during the byte-code runs. -bytecode "Elapsed time: 156.960728s (77.049537s in 3421 GCs)" -native speed 2 "Elapsed time: 94.538094s (46.362582s in 1737 GCs)" -native speed 3 "Elapsed time: 92.288413s (47.509687s in 1816 GCs)" My explanation for that (you'll tell me if it makes sense) is that having to load by hand all the .eln we start the test native compiled tests with a bigger heap: (heap 1024 1065 464) vs (heap 1024 7561 376) As a consequence GC triggers way less often and in the total result count less. This makes a huge difference in a test like this where GC time contribute to ~50% of the perf result. It's not easy to start we with a comparable status for the GC in this situation so I think makes sense to compare just the execution time having removed the GC form the equation. If we do this: | | bytecode | native | native | speed 3 vs | | | | speed 2 | speed 3 | bytecode | |-------------+----------+---------+---------+------------| | non GC time | 80 | 49 | 44 | 1.8x | | GC time | 77 | 46 | 48 | | | Total | 157 | 95 | 92 | | So ~1.8x of execution time excluding GC for the native compiler in the current statu. Please let me know if something looks wrong. There's an heap of room for improvements but I think I'll leave the perf focus for now to continue the bring-up of the missing essential features. Andrea -- akrl@sdf.org