[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compilation speed
From: |
Stefan Monnier |
Subject: |
Re: Compilation speed |
Date: |
Thu, 06 Aug 2020 18:14:20 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> 00:00:22 config.status: executing etc-refcards-emacsver.tex commands
>
> And then ./configure takes 19 seconds, and that's fully single-threaded,
> I believe? And... I'm guessing there's no way to get that to be
> multi-threaded?
This is a long standing and well known issue.
The solutions so far are either:
- move to something else (like `cmake`)
- live with it
IIRC Tom Tromey had started work on some autoconf replacement written in
GMake, but...
I believe the most promising practical solution is to work on
incrementally (i.e. over many years) splitting Autoconf tests into
separate scripts and add a GMake wrapper around them to run them
in parallel.
This is largely orthogonal to Emacs.
> 00:00:50 Loading emacs-lisp/byte-run (source)...
> 00:00:50 Loading emacs-lisp/backquote (source)...
> [...]
> 00:01:02 Dump complete
>
> And dumping takes 12 seconds.
For re-builds, this is also a very significant chunk, especially since
we often do it twice.
> This seems to proceed in parallell until we reach:
>
> 00:01:17 INFO Scraping files for loaddefs.el...
> [...]
> 00:01:54 INFO Scraping files for loaddefs.el...done
>
> Which is single-threaded and takes a whopping 37 seconds! Could that
> possibly be parallelised in some way?
IIRC this should be generated in parallel with the compilation of the
preloaded files. Not sure why it's not the case.
> But to sum up, (+ 22 12 37 4) => 75 seconds of the Emacs compilation is
> single-threaded, while 90 seconds are multi-threaded (and as machines
> get more and more cores, we'll probably see the single-threaded parts
> take more than 50% of the time spent).
Note that the native-compiler should solve a significant part of this
problem (by increasing the amount of time spent compiling the .elc files
in parallel ;-)
Stefan