From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#23967: 25.1.50; Slow compilation of ns-win.el Date: Sun, 17 Jul 2016 12:20:14 -0400 Message-ID: <87zipgck3l.fsf@users.sourceforge.net> References: <83bn21a8q2.fsf@gnu.org> <83inw88e3k.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1468772498 25563 80.91.229.3 (17 Jul 2016 16:21:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Jul 2016 16:21:38 +0000 (UTC) Cc: larsi@gnus.org, 23967@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 17 18:21:19 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bOooc-0001wr-Qp for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Jul 2016 18:21:15 +0200 Original-Received: from localhost ([::1]:42243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOooc-00053X-45 for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Jul 2016 12:21:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOooV-0004zO-K0 for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2016 12:21:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOooQ-0008Df-HT for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2016 12:21:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOooQ-0008DY-EH for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2016 12:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bOooQ-0000Ru-Ai for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2016 12:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Jul 2016 16:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23967 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23967-submit@debbugs.gnu.org id=B23967.14687724221660 (code B ref 23967); Sun, 17 Jul 2016 16:21:02 +0000 Original-Received: (at 23967) by debbugs.gnu.org; 17 Jul 2016 16:20:22 +0000 Original-Received: from localhost ([127.0.0.1]:54693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bOonm-0000Qi-5G for submit@debbugs.gnu.org; Sun, 17 Jul 2016 12:20:22 -0400 Original-Received: from mail-io0-f179.google.com ([209.85.223.179]:33139) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bOonk-0000QS-El for 23967@debbugs.gnu.org; Sun, 17 Jul 2016 12:20:20 -0400 Original-Received: by mail-io0-f179.google.com with SMTP id 38so142293839iol.0 for <23967@debbugs.gnu.org>; Sun, 17 Jul 2016 09:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=RzVRZxcDvBplRLfMzjjArGzZr8LPeD3l9f7sK8Nru6I=; b=clfd49VlPp9qmpHydz2frRaC4TWAd5IeBjzbD0iy2oWRS2Ta73CX4hOvhiAM8FUX7N SgO40Ci1Hpexx8rcXZV19WFJ2QtHbqDc9SG87VlWexWrS5M2QfulHGwD3bpj5B680//C mmOJPd7XjR/3Vc9ea96xiJ42TXz32Bhvo+LOzb0dlIh3+LgSpEAI1UpyeKQqox9/s2Kp hkc+qlvYjAOM8GDtVqqDQ+2cmA3PS/LvfErNCCUQgdJiKVsCOl6wyvoHsRmKHdWlUPvF ERuVUrmjOgXryXF0N2eeGR3iFILV8bQHq82EbTiKtZatnfoLHOStnxihO0e1dBmDE1b+ o8ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=RzVRZxcDvBplRLfMzjjArGzZr8LPeD3l9f7sK8Nru6I=; b=mzM8Fh0dFlp6tBa7MQB8L+ni3calsgY50ro+dmNaGFrH6W/KKMxk95iJaUXNRBDZ4E TfR2sw1d2wz40hZFoE58Bxr0GFFhTDLIQjE0bp7XlLe1RBa6WRmVITFLawylYDLz+m8Y k5tITfLUw+Vyg9BLd9LXu0vPSJQNWyNdJT7tVSR9nZtWwvk8QRZC4Pu3Z2UPWvtqWvRO oc/sKPEZm2cmFv7kixK/BIWQmNRow7gBT++HHXRW5EUwJAl9+Z79dFuObCXR9dMy5ePt j4+ShhW/tZASSLgi6UMj2VV0NnZlJdz31vTF7Ei+3hFwK4iMuo195n80i83ttVts6cq3 OqeQ== X-Gm-Message-State: ALyK8tKcFuuvFSlF+SRjpYUhYq05nN+6+MFPfmj1BJz46kuy/BcNxJ5LswF7uhKnpCVnDQ== X-Received: by 10.107.180.5 with SMTP id d5mr5712541iof.62.1468772414856; Sun, 17 Jul 2016 09:20:14 -0700 (PDT) Original-Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id m203sm7258107iom.21.2016.07.17.09.20.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Jul 2016 09:20:14 -0700 (PDT) In-Reply-To: <83inw88e3k.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 14 Jul 2016 17:54:23 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121179 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> Could we call `byte-compile' on the byte-compiler functions after loading them? > > Maybe, you will have to try. The bootstrap of the byte compiler is > somewhat tricky, given all the dependencies (see COMPILE_FIRST in > lisp/Makefile.in). So I tried moving the COMPILE_FIRST into loadup.el, which does bring bootstrapping[1] down from 1m5s to 0m47s for me. But IIUC it reduces parallelism when compiling these files, so possibly it's actually a loss overall. [1]: Timed with compile-command = "rm -f bootstrap-emacs ../lisp/emacs-lisp/*.elc && time make bootstrap-emacs" --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=compile-1st-in-loadup.diff Content-Transfer-Encoding: quoted-printable Content-Description: diff diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 12bb9c7..e0d4522 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -100,20 +100,6 @@ AUTOGENEL =3D BYTE_COMPILE_FLAGS =3D \ --eval '(setq load-prefer-newer t)' $(BYTE_COMPILE_EXTRA_FLAGS) =20 -# Files to compile before others during a bootstrap. This is done to -# speed up the bootstrap process. They're ordered by size, so we use -# the slowest-compiler on the smallest file and move to larger files as the -# compiler gets faster. 'autoload.elc' comes last because it is not used = by -# the compiler (so its compilation does not speed up subsequent compilatio= ns), -# it's only placed here so as to speed up generation of the loaddefs.el fi= le. - -COMPILE_FIRST =3D \ - $(lisp)/emacs-lisp/macroexp.elc \ - $(lisp)/emacs-lisp/cconv.elc \ - $(lisp)/emacs-lisp/byte-opt.elc \ - $(lisp)/emacs-lisp/bytecomp.elc \ - $(lisp)/emacs-lisp/autoload.elc - # Prevent any settings in the user environment causing problems. unexport EMACSDATA EMACSDOC EMACSPATH =20 @@ -281,9 +267,7 @@ .SUFFIXES: .el.elc: $(AM_V_ELC)$(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $< =20 -.PHONY: compile-first compile-main compile compile-always - -compile-first: $(COMPILE_FIRST) +.PHONY: compile-main compile compile-always =20 # In 'compile-main' we could directly do # ... | xargs $(MAKE) @@ -336,7 +320,7 @@ semantic: # date. Some .el files don't get compiled because they set the # local variable no-byte-compile. # Calling make recursively because suffix rule cannot have prerequisites. -compile: $(LOADDEFS) autoloads compile-first +compile: $(LOADDEFS) autoloads $(MAKE) compile-main =20 # Compile all Lisp files. This is like 'compile' but compiles files @@ -375,7 +359,7 @@ compile-after-backup: # There is no reason to use this rule unless you only have a single # core and CPU time is an issue. .PHONY: compile-one-process -compile-one-process: $(LOADDEFS) compile-first +compile-one-process: $(LOADDEFS) $(emacs) $(BYTE_COMPILE_FLAGS) \ --eval "(batch-byte-recompile-directory 0)" $(lisp) =20 diff --git a/lisp/loadup.el b/lisp/loadup.el index 5c16464..183944b 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -245,6 +245,31 @@ (load "progmodes/elisp-mode") (load "textmodes/text-mode") (load "textmodes/fill") + +;; Compile the byte compiler. This is done to speed up the bootstrap +;; process. They're ordered by size, so we use the slowest-compiler +;; on the smallest file and move to larger files as the compiler gets +;; faster. 'autoload' comes last because it is not used by 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. +;; +;; The byte compiler requires elisp-mode for parsing, and fill +;; functions for printing warnings. +(if (equal (member "bootstrap" command-line-args) '("bootstrap")) + (let (;; $HOME is not defined(!?), so (expand-file-name "~") + ;; crashes (called from `abbreviate-file-name'). + (abbreviated-home-dir "/home/dir") + ;; dir locals needs time-date(?) + (enable-dir-local-variables nil)) + (message "byte compiling the byte compiler...") + (setq debug-on-error t) + (mapc (lambda (file) + (setq file (locate-file file load-path '(".elc" ".el"))) + (or (equal (substring file -4) ".elc") + (byte-compile-file file t))) + '("macroexp" "cconv" "byte-opt" "bytecomp" "autoload")))) + (load "newcomment") =20 (load "replace") diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index f360791..b8d1d51 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -235,7 +235,7 @@ emacs-lisp-mode (append '((?\` . ?\') (?=E2=80=98 . ?=E2=80=99)) electric-pa= ir-text-pairs)) (setq-local electric-quote-string t) (setq imenu-case-fold-search nil) - (add-function :before-until (local 'eldoc-documentation-function) + (add-function :before-until (local 'eldoc-documentation-functions) #'elisp-el --=-=-=--