From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Compilation to native Date: 23 Mar 2004 23:43:28 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <87eks0654s.fsf@sno.mundell.ukfsn.org> <87n06bp4ng.fsf@sno.mundell.ukfsn.org> <877jxccutf.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 1080082131 31549 80.91.224.253 (23 Mar 2004 22:48:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 23 Mar 2004 22:48:51 +0000 (UTC) Cc: Matthew Mundell , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Mar 23 23:48:42 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 1B5uhO-0005VD-00 for ; Tue, 23 Mar 2004 23:48:42 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B5uhN-0001df-00 for ; Tue, 23 Mar 2004 23:48:42 +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 1B5uer-0005Fh-0w for emacs-devel@quimby.gnus.org; Tue, 23 Mar 2004 17:46:05 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B5ueP-0005E2-Jg for emacs-devel@gnu.org; Tue, 23 Mar 2004 17:45:37 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B5udt-00056U-T8 for emacs-devel@gnu.org; Tue, 23 Mar 2004 17:45:36 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B5udt-00056Q-PM for emacs-devel@gnu.org; Tue, 23 Mar 2004 17:45:05 -0500 Original-Received: from fencepost.gnu.org ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.24) id 1B5uZJ-0005tE-Rz; Tue, 23 Mar 2004 17:40:22 -0500 Original-To: rms@gnu.org In-Reply-To: Original-Lines: 51 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:20823 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20823 Richard Stallman writes: > The loop _is_ purely computational. > > I was fooled by the indentation, which makes it appear > that the call to current-time-string is inside the loop. > See? > > (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)))) > > Anyway, such a small speedup is not worth the trouble. A factor of 2 for a first attempt? I don't think that is something one should toss lightly. I have jobs here where Emacs spends close to two hours formatting some text in the size of an order of 1MB. If things could be cut into half, that would help a lot. Of course, the solution in the end is to replace the ad-hoc code by something optimized very thoroughly and with all O(n^2) elements removed, but don't forget one thing: Emacs, among other things, is a grand platform for solving problems ad-hoc, and fast prototypes often happen to be inefficient. Cutting times in half, if it turns out that this will be more or less a sustained gain, helps a lot in that ballpark. > Compilation of CCL may be worth while. Or optimization of the CCL > interpreter may be possible. You bet. Saving such a text file takes minutes on my machine, which is plainly ridiculous (600MHz laptop). It is also disconcerting when you have to save because your laptop batteries are running out, and you don't know whether the (computationally intensive) save will finish before things break down. Of course, the autosave (which is done unconverted) should be up to par, but it still is a nuisance if the box hangs saving. I also have other things like preparing large Usenet groups where cutting the time in half would be quite an advantage. Yes, many things might probably be done by substituting elaborate algorithms, but that improves things only at one place. Overall speedups benefit everything. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum