emacs-devel
[Top][All Lists]
Advanced

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

Re: Performance issue w/ `cl-loop`s `collect...into`


From: Tianxiang Xiong
Subject: Re: Performance issue w/ `cl-loop`s `collect...into`
Date: Mon, 9 Apr 2018 08:28:48 -0700

Here's the result of `benchmark-run` on the new code:

(benchmark-run 10 (cl-loop for i in (number-sequence 1 1E6)
                     collect i))

;; => (10.488984668 6 3.555157208999999)

and old code:

(benchmark-run 10 (cl-loop for i in (number-sequence 1 1E6)
                     collect i))

;; => (14.876455789000001 25 2.328459104999999)

So there actually seems to be an improvement due to less GC.

On Mon, Apr 9, 2018 at 5:22 AM, Basil L. Contovounesios <address@hidden> wrote:
Tianxiang Xiong <address@hidden> writes:

> Is there a function to easily time operations in Emacs Lisp? Something
> like Clojure's `core/time`?

There are the macros benchmark-run and benchmark-run-compiled, as
mentioned under (info "(elisp) Profiling").

--
Basil


reply via email to

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