help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Emacs 30.0 warning from `cl-pushnew' and `memql'


From: Emanuel Berg
Subject: Re: Emacs 30.0 warning from `cl-pushnew' and `memql'
Date: Wed, 28 Dec 2022 21:56:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Jean Louis wrote:

> (benchmark 10000000 (prog1 nil 
>   (setq my-list (cons (quote "Word") my-list))))
> → "Elapsed time: 0.823678s"
>
> (benchmark 10000000 (prog1 nil 
>   (push "Word" my-list)))
> → "Elapsed time: 0.824388s"

Don't hard-code that (** 10 7) ...

> So there is no much difference apparently.

You can try with this as well ...

(defmacro measure-time (&rest body)
  "Measure and return the running time of the code block.
http://nullprogram.com/blog/2009/05/28/";
  (declare (indent defun))
  (let ((start (make-symbol "start")))
    `(let ((,start (float-time)))
       ,@body
       (- (float-time) ,start) )))

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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