[Top][All Lists]

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

On elisp running native - deferred compilation

From: Andrea Corallo
Subject: On elisp running native - deferred compilation
Date: Sat, 22 Feb 2020 10:15:50 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hi all,

It's a couple of days that an idea is spinning in my head.  I think we
could imagine the following mechanism:

1- When an .elc is loaded when no .eln is present we load the .elc but
we enqeue an async compilation using 'native-compile-async'.  The async
compilation queue is eaten by a configurable number of parallel

2- When each compilation unit is finished compiling we substitute each
byte-compiled function definition with the new one.

I think we already have most of the infrastructure for that.

The missing (and a little tricky) part is that we would have to avoid
redefining functions that after the first load got already redefined for
some reason.

In a sense we would have something like a jitter (with a per compilation
unit granularity) but in contrast with the conventional jitter approach
we would have .eln already compiled at the next run avoiding having to
boil the same water again.

I think such mechanism would work very well when installing packages
without having to freeze for compiling.  But we could also introduce a
new build target where we native compile only preloaded files.  This
would bring down compile time of one magnitude order.

It's just a (possibly completely broken) idea so I'd like to hear




reply via email to

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