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

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

Re: profiler-report seems to be missing data?


From: Michael Heerdegen
Subject: Re: profiler-report seems to be missing data?
Date: Thu, 16 Aug 2018 17:32:32 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> In that case, perhaps the bindings done by let* take a lot of time
> because these are variables that become local when set, and you have
> many buffers in your session?

I think you are right - one doesn't even have to bind buffer local
variables to get a profiler report where 'let' takes a lot of time
though nothing inside 'let' seems to be responsible.  If I profile this
for example:

#+begin_src emacs-lisp
(defun test ()
  (interactive)
  (mapcar (lambda (x)
            (let ((y1 1)
                  (y2 2)
                  (y3 3))
              (ignore y3)
              (cons x (cons y1 y2))))
          (number-sequence 1 1000000))
  nil)
#+end_src

I get a similar profiler report.  Obviously, the list mapped over is so
huge that simply binding the variables inside the loop takes a
significant part of time if the rest is fast (calling 'cons' in
the example, 'puthash' in the code we speak about).  Things will be
different when running byte compiled code, I guess.


Michael.



reply via email to

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