emacs-devel
[Top][All Lists]
Advanced

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

Re: Enabling native compilation by default when libgccjit is present


From: Arthur Miller
Subject: Re: Enabling native compilation by default when libgccjit is present
Date: Sun, 05 Dec 2021 22:15:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Óscar Fuentes <ofv@wanadoo.es> writes:

> "Jose A. Ortega Ruiz" <jao@gnu.org> writes:
>
>> I'd be curious to know where people are seeing speedups.
>
> In my experience nativecomp is somewhat noticeable while using lsp-mode.
>
> Otherwise, not much, if at all.
>
> The reason for this is not hard to understand for anyone with a little
> bit of knowledge about binary code optimization. For instance, if your
> Elisp code consists on invoking opaque C primitives, the gain of
> compiling it to machine instructions will be mostly irrelevant.

Yes of course, I would definitely agree with you. Native comp has nothing to do
with the C code; and while it does optimization, it is not so much about
optimization, but difference between executing machine code vs interpretted byte
code.

C core is also not all of Emacs. Emacs itself implement lots of functionality in
Lisp code, and packages add usually lots of functionality on top of that. If you
have lots of packages, some people claim they use hundreds, there is lot more
than just executing C wrappers most of time.

But as general idea I do agree with you, if all of emacs functionality was built
in C, and Lisp was just tiny wrapper around, there would be no need for native
comp.

I also have to admit that I am not sure if I understand correctly *what* is
compiled; by what I mean which functions are compiled. As I read original docs 
on
gccemacs by Andrea, in update 1, he says:

"Just top level functions are native compiled, the others (lambda included) are
still kept as byte-code."

I know that in some later update he said that all lambdas are now compiled
too, inclusive anonymous. However I am still not sure what is status on the
others.

Also I wonder how are cl-defmethods in EIEIO compiled: if they are native (or
even byte-code) compiled? If I understand correctly, they are stored in property
list of their respective cl-generic symbol. For example, Helm is build with
EIEIO, so I am not sure if Helm itself is getting much benefit of native comp,
but I am not sure, just speculating now. It would be nice if someone who has
insight can give bit more explanation.




reply via email to

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