unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Speeding up the bootstrap build - a quick hack.
@ 2022-01-17 20:26 Alan Mackenzie
  2022-01-17 20:55 ` Stefan Monnier
                   ` (4 more replies)
  0 siblings, 5 replies; 46+ messages in thread
From: Alan Mackenzie @ 2022-01-17 20:26 UTC (permalink / raw)
  To: emacs-devel

Hello, Emacs.

I sense some unhappiness about emacs-devel occasioned by my branch
scratch/correct-warning-pos, because the build on the branch is a little
slower.

The following may go some way to fixing this slowdown.  Its idea is to
build the lisp directory first by compiling the byte compiler and then
using this to build the native compiler, rather than building the native
compiler directly from interpreted list.

With the amended makefile, my build took 6m 7s.  Before the amendment,
it was around 7m 16s.  This is a saving of around 15%.

This patch is at the stage of being a crude hack, and it has been tried
only on GNU.  It might work on other systems, though.

Enjoy!


diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 3a72034463..b81337d2f3 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -85,6 +85,14 @@ BYTE_COMPILE_FLAGS =
 # the compiler (so its compilation does not speed up subsequent compilations),
 # it's only placed here so as to speed up generation of the loaddefs.el file.
 
+COMPILE_ZEROTH = \
+	$(lisp)/emacs-lisp/macroexp.elc0 \
+	$(lisp)/emacs-lisp/cconv.elc0 \
+	$(lisp)/emacs-lisp/byte-opt.elc0 \
+	$(lisp)/emacs-lisp/bytecomp.elc0 \
+	$(lisp)/emacs-lisp/comp-cstr.elc0 \
+	$(lisp)/emacs-lisp/comp.elc0
+
 COMPILE_FIRST = \
 	$(lisp)/emacs-lisp/macroexp.elc \
 	$(lisp)/emacs-lisp/cconv.elc    \
@@ -298,22 +306,30 @@ $(THEFILE)n:
 # subdirectories, to make sure require's and load's in the files being
 # compiled find the right files.
 
-.SUFFIXES: .elc .el
+.SUFFIXES: .elc0 .elc .el
 
 # An old-fashioned suffix rule, which, according to the GNU Make manual,
 # cannot have prerequisites.
 ifeq ($(HAVE_NATIVE_COMP),yes)
-.el.elc:
+.el.elc0:
+	$(AM_V_ELC)$(emacs) $(BYTE_COMPILE_FLAGS) \
+	--exec "(setq load-suffixes '(\".elc0\" \".el\"))" \
+	-f batch-byte-compile $<
+	mv $<c $@
+
+%.elc : %.el $(COMPILE_ZEROTH)
 	$(AM_V_ELC)$(emacs) $(BYTE_COMPILE_FLAGS) \
+	--exec "(setq load-suffixes '(\".elc0\" \".elc\" \".el\"))" \
 	-l comp -f batch-byte+native-compile $<
 else
 .el.elc:
 	$(AM_V_ELC)$(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $<
 endif
 
-.PHONY: compile-first compile-main compile compile-always
+.PHONY: compile-zeroth compile-first compile-main compile compile-always
 
-compile-first: $(COMPILE_FIRST)
+compile-zeroth: $(COMPILE_ZEROTH)
+compile-first: compile-zeroth $(COMPILE_FIRST)
 
 # In 'compile-main' we could directly do
 #    ... | xargs $(MAKE)


-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply related	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2022-01-24 20:15 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17 20:26 Speeding up the bootstrap build - a quick hack Alan Mackenzie
2022-01-17 20:55 ` Stefan Monnier
2022-01-18 11:56   ` Alan Mackenzie
2022-01-18 13:14     ` Stefan Monnier
2022-01-18 20:27       ` Alan Mackenzie
2022-01-18 20:48         ` Stefan Monnier
2022-01-19 11:50           ` Alan Mackenzie
2022-01-19 14:34             ` Stefan Monnier
2022-01-19 15:24               ` Stefan Monnier
2022-01-18 13:16     ` Robert Pluim
2022-01-18 14:04       ` Alan Mackenzie
2022-01-18 14:13         ` Robert Pluim
2022-01-18 14:24           ` Stefan Monnier
2022-01-18 14:35             ` Robert Pluim
2022-01-18 15:13               ` Robert Pluim
2022-01-18 16:50                 ` Eli Zaretskii
2022-01-18 16:09               ` Andrea Corallo
2022-01-18 18:36               ` Stefan Monnier
2022-01-18 14:05       ` Stefan Monnier
2022-01-18 14:18         ` Robert Pluim
2022-01-17 21:03 ` Lars Ingebrigtsen
2022-01-18  0:46 ` Po Lu
2022-01-18 14:17 ` Eli Zaretskii
2022-01-18 18:40   ` Stefan Monnier
2022-01-18 19:34     ` Eli Zaretskii
2022-01-18 20:28       ` Stefan Monnier
2022-01-18 20:35       ` Alan Mackenzie
2022-01-18 20:50         ` Stefan Monnier
2022-01-19 11:10       ` Alan Mackenzie
2022-01-19 11:46         ` Eli Zaretskii
2022-01-19 16:50           ` Alan Mackenzie
2022-01-19 17:03             ` Eli Zaretskii
2022-01-19 21:32               ` Alan Mackenzie
2022-01-20  9:25                 ` Robert Pluim
2022-01-20 11:35                   ` Alan Mackenzie
2022-01-20 13:18                     ` Robert Pluim
2022-01-20 14:54                       ` Robert Pluim
2022-01-20 18:48                         ` Alan Mackenzie
2022-01-20 22:29                           ` Stefan Monnier
2022-01-21  8:17                             ` Robert Pluim
2022-01-21 10:18                 ` Stephen Leake
2022-01-21 10:42                   ` David Engster
2022-01-21 10:51                   ` Robert Pluim
2022-01-24 19:43 ` Andrea Corallo
2022-01-24 19:54   ` Eli Zaretskii
2022-01-24 20:15     ` Andrea Corallo

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).