From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: builds are getting slower? Date: Tue, 15 Dec 2015 18:15:07 +0200 Message-ID: <83d1u73cz8.fsf@gnu.org> References: <8337vab7nx.fsf@gnu.org> <0d7fkmdxj1.fsf@fencepost.gnu.org> <566D0BEB.4010707@cs.ucla.edu> <52wpsif21j.fsf@fencepost.gnu.org> <6tpoy9aorv.fsf@fencepost.gnu.org> <83fuz54sfk.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1450196112 30162 80.91.229.3 (15 Dec 2015 16:15:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Dec 2015 16:15:12 +0000 (UTC) Cc: rgm@gnu.org, eggert@cs.ucla.edu, emacs-devel@gnu.org To: bruce.connor.am@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 15 17:15:01 2015 Return-path: Envelope-to: ged-emacs-devel@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 1a8sFg-0006IN-Nl for ged-emacs-devel@m.gmane.org; Tue, 15 Dec 2015 17:15:00 +0100 Original-Received: from localhost ([::1]:37774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8sFg-0001HY-3S for ged-emacs-devel@m.gmane.org; Tue, 15 Dec 2015 11:15:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8sFc-0001GV-K5 for emacs-devel@gnu.org; Tue, 15 Dec 2015 11:14:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8sFY-0001sS-Im for emacs-devel@gnu.org; Tue, 15 Dec 2015 11:14:56 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8sFY-0001sM-FV; Tue, 15 Dec 2015 11:14:52 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2896 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1a8sFX-0002RQ-Ic; Tue, 15 Dec 2015 11:14:51 -0500 In-reply-to: (message from Artur Malabarba on Tue, 15 Dec 2015 12:38:07 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:196311 Archived-At: > Date: Tue, 15 Dec 2015 12:38:07 +0000 > From: Artur Malabarba > Cc: Eli Zaretskii , Paul Eggert , emacs-devel > > > On investigation, I find 2e84888 caused a 20% increase in build time. > > > > Looks like that's my commit. I'm attaching the diff of this commit > below so that people can have a look and help pinpoint something. > I only see 2 things that could be to blame: > > 1. dir-locals-find-file changed quite a bit. I suspect it is called > once for each .el file we compile? In this situation, the local-vars > cache should kick in and avoid the slowness, but maybe there's a bug > where the cache is not being used. > 2. There's a new (require 'map) inside one of the functions and a > (require 'seq) inside another. (I put these inside the functions so > that they would only be loaded when necessary, but if it's getting > loaded at boot, perhaps these should just go at the top level). Anyway > (require 'seq) could be a bit heavy because it uses cl-generic and > cl-extra, but I'd be really surprised if this amounted to 20% of the > build time. Maybe I'm reading the code wrongly, but it looks like even before the cache could kick in, dir-locals-find-file calls locate-dominating-file, passing it dir-locals--all-files as its predicate. This has 2 effects: (a) it loads "seq", and (b) it calls file-expand-wildcards, which needs to read the entire directory and then match each file against a regexp. Could these be the cause of slowdown?