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: Thu, 28 Nov 2019 14:07:21 +0000 Message-ID: References: <87blswutij.fsf@telefonica.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="156614"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (berkeley-unix) Cc: emacs-devel@gnu.org To: =?utf-8?Q?=C3=93scar?= Fuentes Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 28 16:00:21 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 1iaLHJ-000eZT-2I for ged-emacs-devel@m.gmane.org; Thu, 28 Nov 2019 16:00:21 +0100 Original-Received: from localhost ([::1]:49834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaLHH-0006xc-Q7 for ged-emacs-devel@m.gmane.org; Thu, 28 Nov 2019 10:00:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59026) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaKSE-0007TX-9w for emacs-devel@gnu.org; Thu, 28 Nov 2019 09:07:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iaKS6-0005eV-2o for emacs-devel@gnu.org; Thu, 28 Nov 2019 09:07:32 -0500 Original-Received: from mx.sdf.org ([205.166.94.20]:61241) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iaKS5-0005NP-Pn for emacs-devel@gnu.org; Thu, 28 Nov 2019 09:07:26 -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 xASE7MkG010809 (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits) verified NO); Thu, 28 Nov 2019 14:07:22 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id xASE7Lin025601; Thu, 28 Nov 2019 14:07:21 GMT In-Reply-To: <87blswutij.fsf@telefonica.net> (=?utf-8?Q?=22=C3=93scar?= Fuentes"'s message of "Thu, 28 Nov 2019 12:31:32 +0100") 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:242834 Archived-At: =C3=93scar Fuentes writes: > Andrea Corallo writes: > >> Hi all. I'd like share the investigation I've been working on to give >> Emacs the ability to compile and run elisp as native code. >> >> Despite being in very early stage it's functional and shows some quite >> interesting potential in terms of performance benefit. I then thought >> was at a good stage to be shared and discussed. >> >> I wrote a small page to describe what I did and how it works plus the >> current status not to have the information spread in various mails. >> >> http://akrl.sdf.org/gccemacs.html > > nbody is ~3.5x faster with > > No, it is ~4.6 faster :-) > > Please consider using factors instead of % for indicating the speed > boost on the table. Percentages are confusing. Ops... Apparently this was sufficently confusing to confuse my self :) Should be fixed by now. > > One interesting topic is how your approach affects the features that > characterizes Emacs, such as the ability to redefine almost anything at > runtime, instrospection, debugging, etc. > Good points: * Debuggability What you get from native compiled code should be more or less what you get from the byte-compiled one. The caveat is that at speed >=3D 2 currently I'm optimizing out the funcall trampoline for calling primitive C functions. This should impact the back-trace accuracy. A possible solution would be to emit some native code to record that before each call. Another one is not to perform this optimization at all. This is a trade-off. * Introspection As for the previous point this should be the same of what you get with the byte-compiled code (once I get the doc working). * Ability redefine to functions at run-time Nothing should change up to speed 2 here. At speed 3 the compiler can in-line within the compilation unit so you have to recompile it all. I see speed 3 like the setting where you allow a bit more extreme optimizations to be performed. Something to be used not often and with extreme care. Andrea -- akrl@sdf.org