unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* funcall consing
@ 2021-12-31 11:01 Tomas Hlavaty
  2021-12-31 12:33 ` Eli Zaretskii
  2021-12-31 14:27 ` LdBeth
  0 siblings, 2 replies; 17+ messages in thread
From: Tomas Hlavaty @ 2021-12-31 11:01 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-01-02 18:53 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-31 11:01 funcall consing Tomas Hlavaty
2021-12-31 12:33 ` Eli Zaretskii
2021-12-31 15:09   ` LdBeth
2021-12-31 17:00     ` Tomas Hlavaty
2021-12-31 18:42     ` Eli Zaretskii
2022-01-01  4:47       ` Richard Stallman
2022-01-01  7:26         ` Eli Zaretskii
2022-01-02 13:30           ` Tomas Hlavaty
2022-01-02 14:46             ` Eli Zaretskii
2022-01-02 15:59               ` Tomas Hlavaty
2022-01-02 18:53             ` Stefan Monnier
2022-01-01  4:51       ` LdBeth
2022-01-01  7:28         ` Eli Zaretskii
2022-01-01 17:05           ` Stefan Monnier
2022-01-01 17:21             ` Eli Zaretskii
2021-12-31 14:27 ` LdBeth
2021-12-31 16:56   ` Tomas Hlavaty

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).