emacs-devel
[Top][All Lists]
Advanced

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

Re: Native compilation: the bird-eye view


From: Stefan Monnier
Subject: Re: Native compilation: the bird-eye view
Date: Tue, 02 Jun 2020 11:16:46 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

I see you haven't gotten much feedback about this yet, so I'll chime in.

> Currently a .el file is compiled as:
> /bar/foo.el => /bar/eln-x86_64-pc-linux-gnu-d241bf45dde51f21/foo.eln
> where the directory name eln-... disamiguates architecture triplet and
> Emacs version/configuration.
>
> One option would be in case to fall back in deposing the eln in something
> like:
>
> ~/.emacs.d/eln-cache/bar/eln-x86_64-pc-linux-gnu-d241bf45dde51f21/foo.eln
>
> Both the directories would be added into the effective load path during
> load if existing.

This is OK but doubles the length of the effective `load-path`.
Another option would be to use

    ~/.emacs.d/eln-cache/eln-x86_64-pc-linux-gnu-d241bf45dde51f21/<HASH>.eln

where <HASH> is a hash of the corresponding .el(c) file name.  Similarly, 
instead of

    /bar/foo.el => /bar/eln-x86_64-pc-linux-gnu-d241bf45dde51f21/foo.eln

we would store those compiled files to a "global eln-cache"

    /bar/foo.el => 
/usr/lib/eln-cache/eln-x86_64-pc-linux-gnu-d241bf45dde51f21/<HASH>.eln

So we'd have a `eln-cache-path` where to search for those files and when
loading a file we'd first look for the .el file in `load-path` and once
found, we'd look inside `eln-cache-path` to see if that file has
a compiled version available.  `eln-cache-path` would be expected to be
short (2 entries in the typical case).


        Stefan




reply via email to

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