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: 22 Mar 2004 23:42:52 +0000 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <877jxccutf.fsf@sno.mundell.ukfsn.org> References: <87eks0654s.fsf@sno.mundell.ukfsn.org> <87n06bp4ng.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 1079999204 22414 80.91.224.253 (22 Mar 2004 23:46:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 22 Mar 2004 23:46:44 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Mar 23 00:46:34 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 1B5Z7q-00069z-00 for ; Tue, 23 Mar 2004 00:46:34 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B5Z7p-0004qQ-00 for ; Tue, 23 Mar 2004 00:46:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B5Z66-0002BV-5c for emacs-devel@quimby.gnus.org; Mon, 22 Mar 2004 18:44:46 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B5Z4x-0001tz-Vc for emacs-devel@gnu.org; Mon, 22 Mar 2004 18:43:35 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B5Z4Q-0001Um-9Q for emacs-devel@gnu.org; Mon, 22 Mar 2004 18:43:33 -0500 Original-Received: from [217.158.120.143] (helo=mail.ukfsn.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B5Z4P-0001US-Sf; Mon, 22 Mar 2004 18:43:01 -0500 Original-Received: from localhost (lucy.ukfsn.org [127.0.0.1]) by mail.ukfsn.org (Postfix) with ESMTP id 04967E6D4D; Mon, 22 Mar 2004 23:42:34 +0000 (GMT) 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 00749-01; Mon, 22 Mar 2004 23:42:33 +0000 (GMT) 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 8C6E0E6A9A; Mon, 22 Mar 2004 23:42:33 +0000 (GMT) Original-Received: from sno.mundell.ukfsn.org ([10.0.0.3]) by sno.mundell.ukfsn.org with esmtp (Exim 3.36 #1 (Debian)) id 1B5Z4I-00024S-00; Mon, 22 Mar 2004 23:42:54 +0000 Original-To: rms@gnu.org Original-Lines: 45 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:20752 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20752 Richard Stallman writes: > (byte-compile 'silly-loop) > (silly-loop 100000000) > => ("Sat Feb 28 10:06:37 2004" "Sat Feb 28 10:06:53 2004") ; 16 secs > > (native-compile 'silly-loop) > (silly-loop 100000000) > => ("Sat Feb 28 10:17:13 2004" "Sat Feb 28 10:17:22 2004") ; 9 secs > > I don't think that a speedup of less than a factor of 2 would be worth > installing something that might take substantial maintenance effort. The example may come within a factor of 2 with Fsub1 and Fgtr inlined instead of called. This depends on the proportion of time being spent in set_internal. I'll try it. > However, it could be that this test is a bad test and doesn't really > show the benefit of compilation. Maybe this loop spends most of the > time inside current-time-string. How about trying something purely > computational? The loop _is_ purely computational. The calls to current-time-string are only to record the time before and after the loop. (defun silly-loop (n) "Return time before and after N iterations of a loop." (let ((t1 (current-time-string))) (while (> (setq n (1- n)) 0)) (list t1 (current-time-string)))) I think that this example favours the native compilation, as the operations in the loop are relatively short. > The changes require NO_UNION_TYPE to be set, USE_LSB_TAG to be clear, > and EMACS_INT to be an int. > > It will be necessary to remove these restrictions to make it ready to > install. However, there's no harm working initially on this case > and handling other cases later. The change adds macros to lisp.h to deal with the differences controlled by these settings. Adding the other cases should simply entail completing the macros for them.