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: Compiling byte code to native Date: 02 Jun 2004 12:43:41 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87u0xuuqvm.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 1086176649 21290 80.91.224.253 (2 Jun 2004 11:44:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 2 Jun 2004 11:44:09 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Jun 02 13:44:01 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 1BVUA5-0003lL-00 for ; Wed, 02 Jun 2004 13:44:01 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BVUA4-0006sp-00 for ; Wed, 02 Jun 2004 13:44:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BVUAM-0003dC-91 for emacs-devel@quimby.gnus.org; Wed, 02 Jun 2004 07:44:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BVUAE-0003cz-CN for emacs-devel@gnu.org; Wed, 02 Jun 2004 07:44:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BVUAD-0003cg-GC for emacs-devel@gnu.org; Wed, 02 Jun 2004 07:44:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BVUAD-0003cd-Dg for emacs-devel@gnu.org; Wed, 02 Jun 2004 07:44:09 -0400 Original-Received: from [217.158.120.143] (helo=mail.ukfsn.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BVU9r-0008Pa-0N for emacs-devel@gnu.org; Wed, 02 Jun 2004 07:43:47 -0400 Original-Received: from localhost (lucy.ukfsn.org [127.0.0.1]) by mail.ukfsn.org (Postfix) with ESMTP id 22911E6E3F for ; Wed, 2 Jun 2004 12:42:32 +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 16332-05 for ; Wed, 2 Jun 2004 12:42:32 +0100 (BST) Original-Received: from sno.mundell.ukfsn.org (dsl82-163-187-89.as15444.net [82.163.187.89]) by mail.ukfsn.org (Postfix) with ESMTP id C6542E6DF9 for ; Wed, 2 Jun 2004 12:42:31 +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 1BVU9n-0000Ja-00 for ; Wed, 02 Jun 2004 12:43:43 +0100 Original-To: emacs-devel Original-Lines: 48 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:24402 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:24402 The native compilation effort introduced earlier this year is archived at http://www.mundell.ukfsn.org/native. It can now compile all the byte codes. Here are three speed comparisons. The commas in the middle column separate runs. microseconds size in bytes copy-tree Byte 21, 21, 20, 21, 18 100 Native 28, 14, 14, 16, 17 2332 last Byte 15, 15, 16, 14, 15, 14 65 Native 12, 12, 12, 13, 19, 9 1605 native-test-info-eg-loop-small [1] Byte 187, 231, 233, 235, 235, 237, 485 13 Native 113, 158, 164, 172, 173, 186, 225 302 So the speedup over byte code is available, but it seems that in most cases it will be over-shadowed by the time spent in primitives. It may be good to update the TODO entry: ** Investigate using GNU Lightning or similar system for incremental compilation of selected bytecode functions to subrs. [There is an effort archived at http://www.mundell.ukfsn.org/native that can compile byte-code functions to native.] In the future perhaps this work could be a base or reference for adding compilation of functions to primitives. Thanks. [1] Passing 1000 to: (defun native-test-info-eg-small (n) "Return time before and after N iterations of a loop. This is the info manual's byte code speed example." (let ((t1 (current-time-string))) (while (> (setq n (1- n)) 0)) (list t1 (current-time-string))))