From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Matthew Mundell Newsgroups: gmane.emacs.devel Subject: Re: Compilation to native Date: 31 Mar 2004 19:58:49 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87wu50vo5y.fsf@sno.mundell.ukfsn.org> References: <87eks0654s.fsf@sno.mundell.ukfsn.org> <87n06bp4ng.fsf@sno.mundell.ukfsn.org> <877jxccutf.fsf@sno.mundell.ukfsn.org> <87k712gesk.fsf@sno.mundell.ukfsn.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1080759811 25022 80.91.224.253 (31 Mar 2004 19:03:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 31 Mar 2004 19:03:31 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Mar 31 21:03:20 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B8kzg-0002Y5-00 for ; Wed, 31 Mar 2004 21:03:20 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B8kzf-0001VS-00 for ; Wed, 31 Mar 2004 21:03:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B8kwX-0002Oc-Ub for emacs-devel@quimby.gnus.org; Wed, 31 Mar 2004 14:00:05 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B8kwQ-0002MJ-F0 for emacs-devel@gnu.org; Wed, 31 Mar 2004 13:59:58 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B8kvu-00021Q-6f for emacs-devel@gnu.org; Wed, 31 Mar 2004 13:59:57 -0500 Original-Received: from [217.158.120.143] (helo=mail.ukfsn.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B8kvN-0001r0-T3; Wed, 31 Mar 2004 13:58:54 -0500 Original-Received: from localhost (lucy.ukfsn.org [127.0.0.1]) by mail.ukfsn.org (Postfix) with ESMTP id 65E93E6E71; Wed, 31 Mar 2004 19:57:36 +0100 (BST) Original-Received: from mail.ukfsn.org ([127.0.0.1]) by localhost (lucy.ukfsn.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 10834-14; Wed, 31 Mar 2004 19:57:36 +0100 (BST) Original-Received: from sno.mundell.ukfsn.org (dsl213-218-238-16.as15444.net [213.218.238.16]) by mail.ukfsn.org (Postfix) with ESMTP id 05914E6E23; Wed, 31 Mar 2004 19:57:36 +0100 (BST) Original-Received: from sno.mundell.ukfsn.org ([10.0.0.3]) by sno.mundell.ukfsn.org with esmtp (Exim 3.36 #1 (Debian)) id 1B8kvK-0000ZO-00; Wed, 31 Mar 2004 19:58:50 +0100 Original-To: David Kastrup Original-Lines: 42 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:21134 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21134 David Kastrup writes: > Matthew Mundell writes: [...] > > > This is for the record, at least. The speedup is a little better > > with Fgtr inlined into the native, a few excess memory instructions > > saved, and, where possible, objects passed between byte operations > > using registers instead of the stack. > > > > Byte compiled: > > ("Tue Mar 30 21:54:05 2004" "Tue Mar 30 21:54:21 2004") 16 s > > ("Tue Mar 30 21:54:26 2004" "Tue Mar 30 21:54:42 2004") 16 s > > ("Tue Mar 30 21:54:45 2004" "Tue Mar 30 21:55:01 2004") 16 s > > > > Compiled from byte code to native: > > ("Tue Mar 30 21:55:43 2004" "Tue Mar 30 21:55:49 2004") 6 s > > ("Tue Mar 30 21:55:51 2004" "Tue Mar 30 21:55:58 2004") 7 s > > ("Tue Mar 30 21:56:01 2004" "Tue Mar 30 21:56:07 2004") 6 s > > This sounds impressive, but of course in real-life tasks the amount of > work done by the Lisp interpreter as opposed to C primitives should be > less. One would have to see the memory impact as well to find out > whether the overall gains in processing speed would remain as > impressive. Well, compiling to native creates a primitive. Inlining in the generated code causes a size increase in the same way as inlining does in the static code. The dynamic native example is about 1000 bytes. An equivalent primitive runs in under a second and is about 200 bytes. Some of the differences in speed and size will be due to the way the Lightning macros immediately write out instructions, compared to the c compiler's use of an intermediate representation. I think the rest comes down to how much work the dynamic compiler puts into the compilation, and the information available at compile time about the context of the Lisp code. Perhaps passing variable type and binding information to the compilers will improve the differences. I think Juri's reference to the CL declarations suggests this.