guachoperez · 2022-08-11 09:08
According to[the docs](https://www.gnu.org/software/emacs/manual/html_node/elisp/Building-Emacs.html), the c source files generate an executable called temacs which is just the lisp interpreter plus IO routines. This then loads the lisp libraries which provide the full emacs experience. The manual then says that temacs dumps some files according to the shell arguments it received.
If it received pdump, it dumps an exact copy of itself plus the recorded routines from the lisp libraries it loaded (into a file called emacs.pdump).
If it received dump, it dumps an executable lisp image of itself with all the lisp libraries already loaded.
It would make sense to me that the 2nd option is the one used to distribute emacs via package managers, but according to the docs, this option is deprecated.
Does this mean that when i apt install emacs, I am installing the exact copy of temacs + an emacs.pdump file?
Also, if using "pdump" the dumped executable is an exact copy of temacs, could I stop the build process right after the C source has compiled and use temacs as a bare bones emacs (maybe load the lisp libraries myself)?
Im not planning to do this, im just curious about the mechanics of the process.
[deleted] · 2022-08-11 09:36
[deleted]
7890yuiop · 2022-08-11 11:27
The "dump" ("unexec") method is deprecated because support for it ceased upstream in glibc. https://lwn.net/Articles/673724/
> could I stop the build process right after the C source has compiled and use temacs as a bare bones emacs (maybe load the lisp libraries myself)?
Yes, you've always been able to do this by building Emacs yourself. You can run `temacs` directly.
You can also modify `loadup.el` to change what gets loaded before dumping, and then build an executable with your customisations.
7890yuiop · 2022-08-11 11:31
I mean... you've never *needed* a dumped executable, but it's done so that the start-up time isn't awful. That doesn't change in the slightest with native compilation (if anything, load times for native-comp libraries are very slightly slower; the win with native-comp is at run-time, not load-time).
__david__ · 2022-08-11 12:06
This is easy to check, just dump the package. For instance, on my Debian machine:
$ dpkg -L emacs-gtk | grep emacs.pdmp
/usr/lib/emacs/27.1/x86_64-linux-gnu/emacs.pdmp
[deleted] · 2022-08-11 16:13
[deleted]
7890yuiop · 2022-08-12 05:21
Are you suggesting that the difference in start-up time is negligible between a dumped emacs (either pdump or unexec) without native-compilation support, and an undumped emacs with native-compilation support?
[deleted] · 2022-08-12 05:26
[deleted]
7890yuiop · 2022-08-12 05:40
Have you tested that theory?
I believe you will find that you are incorrect, and probably by an order of magnitude.
[deleted] · 2022-08-12 06:17
[deleted]
7890yuiop · 2022-08-12 07:16
I am presuming that your Emacs 28 build also used pdump (as it will by default). Have you compiled it yourself and done benchmarking with an undumped executable? All standard builds of Emacs use some form of dumping. (It sounds a little like you're under the misapprehension that building with native compilation disables dumping.)
Edit: I'll take the fact that you've now deleted all your posts (if not what I presume were your down-votes) from this discussion as confirmation of that.
[deleted] · 2022-08-12 07:22
[deleted]