help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Native compilation by default?: Was [Re: stats say SBCL is 78 875 %


From: Emanuel Berg
Subject: Re: Native compilation by default?: Was [Re: stats say SBCL is 78 875 % faster than natively compiled Elisp
Date: Tue, 21 Feb 2023 17:35:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii wrote:

>> Is my understanding of the documentation - that native
>> compilation is an automatic side effect of byte
>> compiling, wrong?
>
> Yes, it's wrong. Native compilation happens automatically
> when you _load_ a .elc file, not when you compile it.

It doesn't happen when you byte-compile but it also don't
happen when you load it, or that depends what you mean
by "load"ing.

To `load-file' an .elc does not trigger native compilation of
as we have said in this thread (and it is correct), I know
this because all my files are byte-compiled but not all of
them are natively compiled.

My theory was that it only happens when you `require' the
.elc, possibly it also requires that the file you `require'
from is also natively compiled? But then, again, I don't
understand how it all starts?

Madhu: For you to do the test on the natively compiled code,
look in your dir of cached natively compiled files,

  ~/.emacs.d/eln-cache/

and run the file from there with the shell command:

  $ emacs -Q -batch -l fib.el                    [8.660 s]
  $ emacs -Q -batch -l fib.elc                   [3.386 s]
  $ emacs -Q -batch -l fib-54a44480-bad305eb.eln [3.159 s]
  $ sbcl -l fib.cl                               [0.004 s]

Now, when looking at it, I'm unsure if I made a mistake in
test #2, i.e. the fib.elc file, because maybe if the natively
compiled file, the .eln, was present, in fact that was run
there as well?

I'll investigate this further God willing but that is a side
show, the straightforward way is still to just natively
compile everything - since we know that is the fastest way to
run Elisp code anyway - and then compare that to SBCL/CL.

All is in this file:

  https://dataswamp.org/~incal/emacs-init/fib.el

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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