emacs-devel
[Top][All Lists]
Advanced

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

Re: funcall consing


From: Eli Zaretskii
Subject: Re: funcall consing
Date: Fri, 31 Dec 2021 14:33:47 +0200

> From: Tomas Hlavaty <tom@logand.com>
> Date: Fri, 31 Dec 2021 12:01:09 +0100
> 
> in order to optimize some elisp code, I am trying to understand where my
> consing comes from.  So far it looks like that my assumption about the
> cause of consing are wrong and that the cause of consing is funcall.  Is
> that plausible?  I am seeing similar results like this (lexical-binding,
> also byte compiled):
> 
> (benchmark-run 10 (dotimes (i 100000) (1+ i)))
> ;;(2.720941123 40 1.7525918699999998)
> (let ((x (lambda (i) (1+ i)))) (benchmark-run 10 (dotimes (i 100000) (funcall 
> x i))))
> ;;(4.9373091140000005 80 3.4835688719999958)
> 
> i.e. funcall conses a lot and introduces cca double performance penalty.

What do you mean by "consing" in this context, and what is your
evidence for "consing" in the above example?  Is that only the
performance degradation, or is that something else?



reply via email to

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