emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compilation to native


From: David Kastrup
Subject: Re: Compilation to native
Date: 23 Mar 2004 23:43:28 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Richard Stallman <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]