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: Compilation speed Date: Thu, 06 Aug 2020 18:14:20 -0400 Message-ID: References: <87bljnby36.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1856"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 07 00:14:58 2020 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 1k3oA5-0000MT-SZ for ged-emacs-devel@m.gmane-mx.org; Fri, 07 Aug 2020 00:14:57 +0200 Original-Received: from localhost ([::1]:49762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3oA4-00029v-Un for ged-emacs-devel@m.gmane-mx.org; Thu, 06 Aug 2020 18:14:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3o9a-0001jI-Tm for emacs-devel@gnu.org; Thu, 06 Aug 2020 18:14:27 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33005) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3o9Y-0002ti-CC for emacs-devel@gnu.org; Thu, 06 Aug 2020 18:14:25 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id F1183100569; Thu, 6 Aug 2020 18:14:22 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4BE0D100283; Thu, 6 Aug 2020 18:14:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1596752061; bh=WlESs73OPl9g5PEnIWtzs0meHyuXtPXeBUMwA842POY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=fxFaRdr6scLF8zXACuFhVNFWQdP/Z/hAKxjTp6JETBecZ9GVPvSgau4tMKS1zOpTr Dh4L1JZgzU2rr6DfaFrma+OPAT6G0+l0AjKRG6GHLsVb0jsNxnMy1FUxwtQulXcTtv 9yyX7hsRnBLjh90LCtbmN/PNKF8aG4IzUrLeEawaYDtUqaJ49wmtBdWU08rz+MgcrP Y8AKdhOxbIOMppQo9SaG7IP9CU1WNhcRZXITRopSk7gaTMR3JBVhuV5q8MgugMNQoj 4YOJzYU/gMvDz4YEpYjNGqm8Fz1YRsBJKZnvz91etZwTN3QxY+hyw7+8Sc1izN6h5F 29GYMOQ8YejAw== Original-Received: from milanesa (unknown [45.72.246.108]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0882C1203B2; Thu, 6 Aug 2020 18:14:20 -0400 (EDT) In-Reply-To: <87bljnby36.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 06 Aug 2020 17:20:13 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/06 18:14:23 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] 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, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:253486 Archived-At: > 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