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: Charlie Andrews
Subject: Re: profiler-report seems to be missing data?
Date: Thu, 16 Aug 2018 13:12:23 -0400

Any tips on making these let bindings faster? I've read online that
enabling lexical binding for the plugin might help.

On Thu, Aug 16, 2018 at 12:34 PM Michael Heerdegen <michael_heerdegen@web.de>
wrote:

> 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]