emacs-devel
[Top][All Lists]
Advanced

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

Re: Why does adding a useless copy-sequence and discarding the result ma


From: Andreas Politz
Subject: Re: Why does adding a useless copy-sequence and discarding the result make my ELisp 40 times faster?
Date: Sat, 25 Mar 2017 11:47:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Clément Pit-Claudel <address@hidden> writes:

> On 2017-03-25 00:06, Clément Pit-Claudel wrote:
>> * Why does running additional, supposedly useless code speed things up so 
>> much? (1)
>
> Interestingly, it turns out that (copy-sequence) isn't needed:
> instead, it's enough to use (sleep-for 0.000001) (or even (sleep-for
> cl-least-positive-normalized-float)) to get the 40x speedup.

What about this explanation: If you make Emacs wait inside the loop, it
can send some of the strings immediately.  Otherwise, it'll have to
store them all/some in memory first.

-ap



reply via email to

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