[Top][All Lists]

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

Re: Prickliness of the "invalid byte code" stuff

From: Stefan Monnier
Subject: Re: Prickliness of the "invalid byte code" stuff
Date: Tue, 18 Jun 2019 14:11:01 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> I know nothing about this variable.  If my opinion is required, I will
> need to read up on that, or maybe someone could just tell more details
> about it.

OK, here's my take on it:
byte-compile-dynamic is a compilation option which makes the .elc file
have the actual bytes of the bytecoded functions lazy-loaded (in the
same way as the docstrings are lazy-loaded: the byte-code-function-p
objects contain in their bytecode field a "pointer" to the
file-and-position so the bytecodes are fecthed on-demand when the
function is called, via `fetch-bytecode`).

This was introduced at the same time as the lazy loading of docstrings.

The files using this option are expected to be faster to load (because
we load a bit less into heap).

I'm claiming that this benefit is not worthwhile.

The downsides are:
- it doesn't work when the .elc files are compressed.
- it doesn't work when the .elc files are loaded via Tramp.
- If the .elc files is re-generated after the .elc file was loaded,
  calling functions from that file typically signal an error (such as
  "invalid byte code").

A `grep byte-compile-dynamic: **/*.el` seems to indicate it's currently
used in 12 files bundled with Emacs.


reply via email to

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