emacs-devel
[Top][All Lists]
Advanced

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

funcall consing


From: Tomas Hlavaty
Subject: funcall consing
Date: Fri, 31 Dec 2021 12:01:09 +0100

Hi,

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.

Is that right or am I doing something wrong?

Would it be possible to improve that?

Thank you in advance

Tomas



reply via email to

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