From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Speeding up the bootstrap build - a quick hack. Date: Mon, 17 Jan 2022 15:55:26 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29954"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 17 21:57:02 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n9Z3l-0007Z3-Ff for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Jan 2022 21:57:01 +0100 Original-Received: from localhost ([::1]:52042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9Z3k-00013N-3i for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Jan 2022 15:57:00 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9Z2M-0007Sp-Fr for emacs-devel@gnu.org; Mon, 17 Jan 2022 15:55:34 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:35323) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9Z2J-0000Gu-Tr for emacs-devel@gnu.org; Mon, 17 Jan 2022 15:55:33 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 32819805B1; Mon, 17 Jan 2022 15:55:29 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C28A780401; Mon, 17 Jan 2022 15:55:27 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1642452927; bh=mLSpIRb8efP5Buht3XcfW5vzzf2lI9G3G/iE5DmyZHs=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=LktpcPD4Ur7ArLeSrP1Yec6k2lawk83nZivoIVCJT3COXJCl+1Z4xlxqf0XKVz3G2 t6qkgNxiFShVxALDReFi78lG7tpQvFK9DcZVOC/j/4SOCmo9jK7q9JlplCwB9nrfXA Jr2rQgExhIzQgYVVmY0YRJc0v3mOwFTEEKQIp/7IPKmiVBmyW2T+omKTYjVONzwFu2 gIDdlWZO/mGc5NvKMAGOrtPqMYhX+ZFzKWqbad3rICrIdaSZPQmwOQY+B6vUOhH1rz mt7FFoXlXPw5FquUEE1mKBzVWAHMIxX89/wKNAjpGwFIq02oqhQ4pKeHvFyN5SgTte 5+CZrdCRfvJbQ== Original-Received: from alfajor (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 75529120202; Mon, 17 Jan 2022 15:55:27 -0500 (EST) In-Reply-To: (Alan Mackenzie's message of "Mon, 17 Jan 2022 20:26:08 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:284907 Archived-At: > 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. Thanks, that's pretty much what I suggested we should do (tho I wasn't too sure *how* to do that ;-) > 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. It looks pretty good and clean, actually. I of course have some comments/questions: > +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 \ Can't COMPILE_ZEROTH be made directly from COMPILE_FIRST so we don't need to maintain two different lists? > # 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 $ +%.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 $< Shouldn't this list have `.elc` before `.elc0` so we use the native-compiled compiler when available? > -.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) Is this necessary, or is it just helpful to debug the Makefile? Stefan